-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
faster_rcnn_r50_1x 训练完成,模型已导出,但在预测时报错。 #544
Comments
这个是因为paddle比较新的版本会对网络定义shape和实际输入shape做检查,可以更新下检测库,release/0.2分支就已经适配了 |
看您使用,还有问题就是导出的inference_model模型请使用INFERENCE方法进行预测。不然加载不了模型,检测不到结果。 |
谢谢你的回答,我在用的就是0.2版本paddleDetection。是和你说的是一个意思吗。 |
可以看下你的配置文件吗,另外确实需要再确认下你infer时加载的模型是否是训练时保存的模型 |
配置文件如下: |
对于infer.py的问题,看了下你的配置文件,你在faster_reader.yml中的配置和https://github.com/PaddlePaddle/PaddleDetection/blob/release/0.2/configs/faster_reader.yml 这里的配置还有些出入,这个也可能是release/0.2期间有过更新,你本地可以再更新下这个分支, 关于cpp_infer的问题,是由于cpp_demo这个配置文件是使用rcnn系列模型的,你这边用的是yolo的模型,这两个模型在输入部分会有些出入,这个我推荐使用master分支,export_model.py会自动根据你测试时的配置生成cpp_infer所需要的配置文件 |
@wyc880622 请使用 |
@wyc880622 由于numpy的最新1.18版本改了一个接口的参数类型,pycocotools里评估时用到这个接口,就报错了,请回退numpy版本或者升级pycocotools,具体参考 #245 #445 的issue解决方案。 |
@wyc880622 如果没有问题先关闭了,还有问题的话可以reopen这个issue。 |
模型导出应该没有问题。
报错内容如下所示:请问大师该如何解决?
(paddle) G:\Halcon\Paddle\PaddleDetection>python -u tools/infer.py -c configs/faster_rcnn_r50_1x.yml -o weights=inference_model\faster_rcnn_r50_1x --infer_img=demo/1.jpg --output_dir=infer_output
W0423 19:38:42.788797 21428 device_context.cc:237] Please NOTE: device: 0, CUDA Capability: 61, Driver API Version: 10.1, Runtime API Version: 10.0
W0423 19:38:42.800806 21428 device_context.cc:245] device: 0, cuDNN Version: 7.6.
2020-04-23 19:38:44,095-INFO: Loading parameters from inference_model\faster_rcnn_r50_1x...
2020-04-23 19:38:44,095-WARNING: inference_model\faster_rcnn_r50_1x.pdparams not found, try to load model file saved with [ save_params, save_persistables, save_vars ]
2020-04-23 19:38:44,095-WARNING: inference_model\faster_rcnn_r50_1x.pdparams not found, try to load model file saved with [ save_params, save_persistables, save_vars ]
2020-04-23 19:38:44,098-WARNING: variable file [ inference_model/faster_rcnn_r50_1x/params inference_model/faster_rcnn_r50_1x/model ] not used
2020-04-23 19:38:44,098-WARNING: variable file [ inference_model/faster_rcnn_r50_1x/params inference_model/faster_rcnn_r50_1x/model ] not used
C:\Users\Administrator\Anaconda3\envs\paddle\lib\site-packages\paddle\fluid\executor.py:804: UserWarning: There are no operators in the program to be executed. If you pass Program manually, please use fluid.program_guard to ensure the current Program is being used.
warnings.warn(error_info)
2020-04-23 19:38:44,100-INFO: Load categories from G:/Halcon/Paddle/PaddleDetection/dataset/coco/annotations/instance_test.json
loading annotations into memory...
Done (t=0.00s)
creating index...
index created!
C:\Users\Administrator\Anaconda3\envs\paddle\lib\site-packages\paddle\fluid\executor.py:782: UserWarning: The following exception is not an EOF exception.
"The following exception is not an EOF exception.")
Traceback (most recent call last):
File "tools/infer.py", line 271, in
main()
File "tools/infer.py", line 185, in main
return_numpy=False)
File "C:\Users\Administrator\Anaconda3\envs\paddle\lib\site-packages\paddle\fluid\executor.py", line 783, in run
six.reraise(*sys.exc_info())
File "C:\Users\Administrator\Anaconda3\envs\paddle\lib\site-packages\six.py", line 703, in reraise
raise value
File "C:\Users\Administrator\Anaconda3\envs\paddle\lib\site-packages\paddle\fluid\executor.py", line 778, in run
use_program_cache=use_program_cache)
File "C:\Users\Administrator\Anaconda3\envs\paddle\lib\site-packages\paddle\fluid\executor.py", line 831, in _run_impl
use_program_cache=use_program_cache)
File "C:\Users\Administrator\Anaconda3\envs\paddle\lib\site-packages\paddle\fluid\executor.py", line 902, in _run_program
self._feed_data(program, feed, feed_var_name, scope)
File "C:\Users\Administrator\Anaconda3\envs\paddle\lib\site-packages\paddle\fluid\executor.py", line 580, in _feed_data
check_feed_shape_type(var, cur_feed)
File "C:\Users\Administrator\Anaconda3\envs\paddle\lib\site-packages\paddle\fluid\executor.py", line 230, in check_feed_shape_type
(var.name, len(var.shape), var.shape, feed_shape))
ValueError: The fed Variable 'image' should have dimensions = 4, shape = (-1, 3, 800, 1333), but received fed shape [1, 3, 800, 1067] on each device
The text was updated successfully, but these errors were encountered: