且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Keras使用训练有素的InceptionV3模型+ CIFAR10遇到了有关批处理大小的错误

更新时间:2023-12-02 12:28:52

您所说的错误是输入大小的差异.预先训练的Imagenet模型比Cifar-10(32,32)拍摄更大的图像.

Your error as you said is the input size difference. The pre trained Imagenet model takes a bigger size of image than the Cifar-10 (32, 32).

您需要像这样手动指定模型的输入形状.

You need to specify the input_shape of the model before hand like this.

Inceptionv3_model = InceptionV3(weights='imagenet', include_top=False, input_shape=(32, 32, 3))

更多说明,您可以查看

For more explanation you can check this tutorial.