0
Follow
0
View

Cannot set tensor: Dimension mismatch

dongchao_123 注册会员
2023-01-25 15:47

Your input tensor is the wrong size. The docs show that your input data should be of shape 1,1:

input_data = tf.constant(1., shape=[1, 1])
interpreter.set_tensor(input['index'], input_data)

I suspect changing the line:

interpreter.set_tensor(input_details[0]['index'], input_tensor)

to

interpreter.set_tensor(input_details['index'], input_tensor)

should fix your issue.

About the Author

Question Info

Publish Time
2023-01-25 15:47
Update Time
2023-01-25 15:47