使用最新版image_classification训练完成后预测出现paddle.fluid.core.EnforceNotMet...错误
Created by: xfliu138
操作系统win7 64位,python版本是3.7.64,本机测试图像识别示例程序image_classification。 训练完成后,用image目录下的dog.png图片验证是正确的,但从网络上随机找了一些猫,船之类的图片,验证时提示如下错误:
Traceback (most recent call last): File "train.py", line 209, in main(use_cuda=False) File "train.py", line 203, in main infer(use_cuda=use_cuda, params_dirname=save_path) File "train.py", line 175, in infer fetch_list=fetch_targets) File "C:\Users\miles.liu\AppData\Local\Programs\Python\Python37\lib\site-packa ges\paddle\fluid\executor.py", line 472, in run self.executor.run(program.desc, scope, 0, True, True) paddle.fluid.core.EnforceNotMet: Enforce failed. Expected in_dims[1] == filter_d ims[1] * groups, but received in_dims[1]:4 != filter_dims[1] * groups:3. The number of input channels should be equal to filter channels * groups. at [E: \dist\Paddle\paddle\fluid\operators\conv_op.cc:60] PaddlePaddle Call Stacks: Windows not support stack backtrace yet. 开始以为图片格式有问题,然后将图片格式改为png,长和高都设定为32与dog.png一致,但还是报以上错误