我收到此错误Error when checking input: expected conv2d_11_input to have 4 dimensions, but got array with shape (300, 300, 3)
如何将 RGB 图像传递给 CNN?如何枚举样本以创建 4D 图像?
卷积函数需要一批图像,即使您有单个图像,您也应该将图像传递为:
# assume img is your RGB image
# add 4th batch dimension
img = np.expand_dims(img, axis=0))
# now you can pass it to CNN
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句