我想用張量流做一個簡單的任務(wù)。但是我遇到一個錯誤import numpy as npimport pandas as pdfv = tf.Variable(10.0,name="first_var")sv = tf.Variable(20.0,np.random.randn(),name="second_var")fvp = tf.placeholder("float32",name="first_fvp",shape=[])svp = tf.placeholder("float32",name="second_svp",shape=[])result = tf.Variable(0.0,name="output")result = np.multiply(fvp,svp)sess = tf.Session()sess.run(tf.global_variables_initializer())print(sess.run(result,feed_dict={fvp:fv,svp:sv}))錯誤=設(shè)置具有序列的數(shù)組元素。在這種情況下,我遇到了錯誤如果我用print(sess.run(result,feed_dict={fvp:5.0,svp:10.0}))我得到50.0的輸出
添加回答
舉報
0/150
提交
取消