テンソルボードを作成しようとすると、構文エラーが表示されます。私はオープンソースコードにもかかわらず理解できません。テンソルボードのコードを検索しようとしましたが、それは不明です。テンソルボードSyntaxError:無効な構文
でも、私はPythonがうまくいかない。私はWindowsの10を使用しているので、この方法でパスを書いている、C:\\Users\\jh902\\Documents\\.logs
しかし、わからない。 (私はダブルバックスラッシュを使用しましたが、このモニターではスラッシュのように見えます)。
私はこのようにコーディングした場合は、
tensorboard --logdir="C:\Users\\jh902\\Documents\\.logs"
this error message comes out
File "<ipython-input-32-4b130bd6177b>", line 1
tensorboard --logdir="C:\Users\\jh902\\Documents\\.logs"
^
SyntaxError: can't assign to operator
は、問題は何ですか?問題は、あなたが余分なスラッシュも不足している可能性が
# cost/loss function
cost = tf.reduce_mean(tf.square(hypothesis - Y))
# Minimize/Optimizer
optimizer = tf.train.AdamOptimizer(learning_rate=1e-5)
train = optimizer.minimize(cost)
# Launch the graph in a session.
sess = tf.Session()
w2_hist=tf.summary.histogram("weight2",W2)
cost_summ=tf.summary.scalar("cost",cost)
summary=tf.summary.merge_all()
#Create Summary writer
writer=tf.summary.FileWriter("C:\\Users\\jh902\\Documents\\.logs")
writer.add_graph(sess.graph)
# Initializes global variables in the graph.
sess.run(tf.global_variables_initializer())
# Fit the Line with new training data
for step in range(1001):
s, cost_val, hy_val, _ = sess.run([summary, cost, hypothesis, train], feed_dict={X: x_data, Y: y_data})
writer.add_summary(s, global_step=step)
if step % 100 == 0:
print(step, "Cost: ", cost_val, "Prediction: ", hy_val)
tensorboard --logdir=C:\\Users\\jh902\\Documents\\.logs
File "<ipython-input-29-82d09538d544>", line 1
tensorboard --logdir=C:\\Users\\jh902\\Documents\\.logs
^
SyntaxError: invalid syntax