llSourcell / tensorflow_demo

Tensorflow Demo for my TF in 5 Min Video on Youtube
229 stars 174 forks source link

InvalidArgumentError executing "summary_str = sess.run(merged_summary_op, feed_dict={x: batch_xs, y: batch_ys})" #1

Closed nelsoncardenas closed 4 years ago

nelsoncardenas commented 7 years ago

Hi Siraj, I have tried to implement your code in Python 3.5.2 with Jupyter Notebook in Windows 8.

It has thrown this error and I cannot figure out how to fix it:

WARNING:tensorflow:Passing aGraphDefto the SummaryWriter is deprecated. Pass aGraphobject instead, such assess.graph`.

InvalidArgumentError Traceback (most recent call last) C:\Users\PERSONAL.conda\envs\py35\lib\site-packages\tensorflow\python\client\session.py in _do_call(self, fn, args) 1020 try: -> 1021 return fn(args) 1022 except errors.OpError as e:`


"InvalidArgumentError Traceback (most recent call last)

in () 18 avg_cost += sess.run(cost_function, feed_dict={x: batch_xs, y: batch_ys})/total_batch 19 #Registrar por cada iteración ->20 summary_str = sess.run(merged_summary_op, feed_dict={x: batch_xs, y: batch_ys}) 21 summary_writer.add_summary(summary_str, iteration*total_batch + i)" ___________________________________________________________________
dkloving commented 7 years ago

Hey, I don't know if this is still an issue for you, but you can use something like this now: summary_writer = tf.train.SummaryWriter('mnist_test', sess.graph)

soumenms2015 commented 7 years ago

InvalidArgumentError Traceback (most recent call last)

in () 20 21 # Write logs for each iteration ---> 22 summary_str = sess.run(merged_summary_op, feed_dict={x: batch_xs, y: batch_ys}) 23 summary_writer.add_summary(summary_str, iteration*total_batch + i) 24 # Display logs per iteration step /usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.pyc in run(self, fetches, feed_dict, options, run_metadata InvalidArgumentError: Duplicate tag weights found in summary inputs [[Node: MergeSummary_2/MergeSummary = MergeSummary[N=18, _device="/job:localhost/replica:0/task:0/cpu:0"](HistogramSummary, HistogramSummary_1, HistogramSummary_2, HistogramSummary_3, weights, biases, weights_1, biases_1, cost_function/ScalarSummary, cost_function_1/cost_function, weights_2, biases_2, weights_3, biases_3, cost_function_2/cost_function, HistogramSummary_4, HistogramSummary_5, cost_function_3/cost_function)]]