我训练了一个期望输入形状为 (None, 9, 100, 100, 3)
的模型。当我运行以下代码时:
start_frame = 1
while success:
vid.set(cv2.CAP_PROP_POS_FRAMES, start_frame)
success, image = vid.read()
image = np.array(image).astype('float32')/255
image = image.reshape(1,*image.shape)
image = np.expand_dims(image, axis=0)
preds = model.predict(image)
我收到以下警告/错误:WARNING:tensorflow:Model was constructed with shape (None, 9, 100, 100, 3) for input Tensor("conv3d_1_input:0", shape=(None, 9, 100, 100, 3), dtype=float32), but it was called on an input with incompatible shape (1, 1, 100, 100, 3).
有什么办法可以解决这个问题吗?