#遇到的问题 报错语句为
RuntimeError: Given groups=1, weight of size [64, 3, 3, 3], expected input[1, 252, 324, 3] to have 3 channels, but got 252 channels instead
原代码数据处理代码如下:
img = cvtColor(img)#将图像转换为RGB格式
img = img.reshape((1, 252, 324, 3))
img = img.astype('float32')
img = img / 255.0
请问该怎么更改原数据处理语句呢?
img = img.reshape((-1,3, 252, 324))
改成这样试试