Reputation: 2743
I am trying to build a image generator that will:
What I cannot figure out is how to actually do this. I am making this as a triple loss so one image is an anchor, positive, and negative image.
It says:
TypeError: len() of unsized object
I have changed the code a bit but now it is giving me this error.
Error when checking input: expected input_1 to have 4 dimensions, but got array with shape (224, 224, 3)
Upvotes: 1
Views: 615
Reputation: 1199
remember that a network expects a batch size. if you're submitting only one image of shape (244,244,3), you'll need to first np.expand_dims(image, axis=0)
to achieve shape (1,244,244,3) prior to prediction. That will be 1 image of 244 by 244 with 3 layers, i.e. (1,244,244,3).
It seems like you have some other dimensions, but the point remains, get that batch size dimension in there; that's what your recent error is saying.
Upvotes: 1