Skip to content
Advertisement

‘cannot compute Pack as input #1(zero-based) was expected to be a float tensor but is a int32 tensor [Op:Pack] name: packed’. Error with tf.squeeze

I’m trying to display images of a dataset on a plot with their predictions. But I have this error: cannot compute Pack as input #1(zero-based) was expected to be a float tensor but is a int32 tensor [Op:Pack] name: packed

This is the code in which I plot:

JavaScript

I have the error on second line, on the tf.squeeze function. I want to remove first dimension of images shape (shape is (18, 360, 360, 3) and I want (360, 360, 3)).

Advertisement

Answer

You are forgetting to reference your labels in your loop. Try something like this:

JavaScript

enter image description here

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement