tutorials icon indicating copy to clipboard operation
tutorials copied to clipboard

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

Open tbdwworks opened this issue 7 years ago • 3 comments

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}

tbdwworks avatar Jul 22 '17 09:07 tbdwworks

Same here.

sepulchered avatar Aug 28 '17 23:08 sepulchered

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]))

rzdulc avatar Aug 30 '17 01:08 rzdulc

@drczuckerman ..works..thanks.

pdhruv93 avatar Sep 06 '18 13:09 pdhruv93