Cannot feed value of shape (1, 256, 256) for Tensor 'sharp:0', which has shape '(None, None, None, 3)'
时间: 2023-05-26 20:06:43 浏览: 63
This error occurs when the input data shape of your model does not match with the actual shape of the data being fed to the model during training or testing.
In this case, the model expects input data with shape (None, None, None, 3), which means that the data should have an unspecified number of samples (None), unspecified width and height (None, None), and 3 color channels (RGB).
However, you are trying to feed input data with shape (1, 256, 256), which means that the data has only one sample, a width of 256, a height of 256, and no color channel information. This does not match the expected input shape of the model.
To resolve this error, you need to reshape or preprocess the input data to match the expected input shape of the model. You can use tools like NumPy or TensorFlow to reshape the data or apply transformations to it. Alternatively, you can modify the input shape of the model to match the actual shape of the data being fed to it.