Tutorials: InvalidArgumentError (see above for traceback): tensor_name = linear//weight

Created on 22 Jul 2017  路  3Comments  路  Source: random-forests/tutorials

print ("Predicted %d, Label: %d" % (classifier.predict(test_data[0]), test_labels[0]))

the below error occurred.
InvalidArgumentError (see above for traceback): tensor_name = linear//weight; shape in shape_and_slice spec [1,10] does not match the shape stored in checkpoint: [784,10]
[[Node: save/RestoreV2_1 = RestoreV2[dtypes=[DT_FLOAT], _device="/job:localhost/replica:0/task:0/cpu:0"](_arg_save/Const_0_0, save/RestoreV2_1/tensor_names, save/RestoreV2_1/shape_and_slices)]]

Although classifier.evaluate(test_data[0:1,:], test_labels[0:1]) is working..
{'accuracy': 1.0, 'global_step': 1000, 'loss': 0.010729363}

Most helpful comment

I got it to work like this:

prediction = classifier.predict(np.array([test_data[0]], dtype=float), as_iterable=False)
print("Predicted %d, Label: %d" % (prediction, test_labels[0]))

All 3 comments

Same here.

I got it to work like this:

prediction = classifier.predict(np.array([test_data[0]], dtype=float), as_iterable=False)
print("Predicted %d, Label: %d" % (prediction, test_labels[0]))

@drczuckerman ..works..thanks.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

linusmotu picture linusmotu  路  4Comments

Anjum48 picture Anjum48  路  8Comments

dansteingart picture dansteingart  路  31Comments

eyaler picture eyaler  路  12Comments

cledoux picture cledoux  路  13Comments