-
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
rtdetrv2导出模型失败 #9211
Comments
我也有一模一样的问题,感觉百度的东西太垃圾了,自己训练生成的模型自己都导不出来,简直不可理解。自己都不内测吗 |
看起来可能是模型不支持太动态的shape,请尝试在导出时添加 |
很抱歉出现这样的问题,感谢你的反馈,我们会努力完善质量监测机制,避免之后再出现这样的问题。也希望来自开源社区的开发者如果感兴趣的话可以一同参与到项目的开发和维护中来,我们一起把这个仓库做好~ |
从paddle 3.0-beta2版本开始,默认启用PIR,使用json格式代替pdmodel格式存储模型。所以这里的model.json其实就相当于以前的model.pdmodel~ |
感谢您这么晚回复 |
我想应该:
对于第1点,可以在paddle官网下载;对于第2点,如果你使用的是PaddleDetection官方的C++推理代码的话,看起来目前这份代码还没有适配json格式模型的情况,可能需要修改这里。 |
另外一种选择是在导出模型时,使用旧版本的paddlepaddle,或者设置环境变量 |
旧版本的paddle是否影响redetrv2的使用呢
在 2024-11-13 00:05:12,"Lin Manhui" ***@***.***> 写道:
另外一种选择是在导出模型时,使用旧版本的paddlepaddle,或者设置环境变量export FLAGS_enable_pir_api=0,以强制使用旧的pdmodel格式。
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
建议尝试使用paddle 2.6(最接近的版本)。 |
好的,我试一下
在 2024-11-13 00:15:30,"Lin Manhui" ***@***.***> 写道:
建议尝试使用paddle 2.6(最接近的版本)。
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
今天试了,添加了也不能导出模型,麻烦解决一下
在 2024-11-12 17:15:47,"Lin Manhui" ***@***.***> 写道:
看起来可能是模型不支持太动态的shape,请尝试在导出时添加-o TestReader.inputs_def.image_shape=[1,3,640,640]选项。
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
请问尝试的是哪一种方案呢 |
TestReader.inputs_def.image_shape=[1,3,640,640]
这个方案导出,提示同样错误
在 2024-11-14 16:00:56,"Lin Manhui" ***@***.***> 写道:
请问尝试的是哪一种方案呢
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
!python tools/export_model.py -c configs/rtdetrv2/rtdetrv2_r50vd_6x_coco.yml 结果如下
|
用这个方案可以导出,但是使用paddleinference推理时失败
在 2024-11-15 01:48:56,"Lin Manhui" ***@***.***> 写道:
看起来可能是模型不支持太动态的shape,请尝试在导出时添加-o TestReader.inputs_def.image_shape=[1,3,640,640]选项。
我直接把出错位置改为[1,3,640,640]`可以导出,但是没有pdmodel后缀的模型文件呢, 而且其他模型导出也是只有这三个文件
想问下用这个方案可以导出不?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
推理时报什么错误呢? |
我也遇到了这个问题,请问有解决方案了吗? |
python tools/export_model.py -c configs/rtdetrv2/rtdetrv2_r101vd_6x_coco.yml -o weights=configs/weights/ResNet101_vd_ssld_pretrained.pdparams trt=True--output_dir=output_inference |
还是有这个问题,rtdetr是可以正常导出的,v2却导出不了 |
问题确认 Search before asking
Bug组件 Bug Component
Export
Bug描述 Describe the Bug
!python tools/export_model.py -c configs/rtdetrv2/rtdetrv2_r50vd_6x_coco.yml
-o weights=https://bj.bcebos.com/v1/paddledet/models/rtdetrv2_r50vd_6x_coco.pdparams
--output_dir=output_inference
[11/11 23:40:07] ppdet.utils.checkpoint INFO: Finish loading model weights: /home/aistudio/.cache/paddle/weights/rtdetrv2_r50vd_6x_coco.pdparams
[11/11 23:40:08] ppdet.data.source.category WARNING: anno_file 'dataset/coco/annotations/instances_val2017.json' is None or not set or not exist, please recheck TrainDataset/EvalDataset/TestDataset.anno_path, otherwise the default categories will be used by metric_type.
[11/11 23:40:08] ppdet.data.source.category WARNING: metric_type: COCO, load default categories of COCO.
[11/11 23:40:08] ppdet.engine INFO: Export inference config file to output_inference/rtdetrv2_r50vd_6x_coco/infer_cfg.yml
Traceback (most recent call last):
File "/home/aistudio/PaddleDetection-release-2.8/tools/export_model.py", line 118, in
main()
File "/home/aistudio/PaddleDetection-release-2.8/tools/export_model.py", line 114, in main
run(FLAGS, cfg)
File "/home/aistudio/PaddleDetection-release-2.8/tools/export_model.py", line 80, in run
trainer.export(FLAGS.output_dir, for_fd=FLAGS.for_fd)
File "/home/aistudio/PaddleDetection-release-2.8/ppdet/engine/trainer.py", line 1282, in export
static_model, pruned_input_spec = self._get_infer_cfg_and_input_spec(
File "/home/aistudio/PaddleDetection-release-2.8/ppdet/engine/trainer.py", line 1233, in _get_infer_cfg_and_input_spec
input_spec, static_model.forward.main_program,
File "/opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages/paddle/jit/dy2static/program_translator.py", line 1098, in main_program
concrete_program = self.concrete_program
File "/opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages/paddle/jit/dy2static/program_translator.py", line 982, in concrete_program
return self.concrete_program_specify_input_spec(input_spec=None)
File "/opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages/paddle/jit/dy2static/program_translator.py", line 1026, in concrete_program_specify_input_spec
concrete_program, _ = self.get_concrete_program(
File "/opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages/paddle/jit/dy2static/program_translator.py", line 914, in get_concrete_program
concrete_program, partial_program_layer = self._program_cache[
File "/opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages/paddle/jit/dy2static/program_translator.py", line 1665, in getitem
self._caches[item_id] = self._build_once(item)
File "/opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages/paddle/jit/dy2static/program_translator.py", line 1603, in _build_once
concrete_program = ConcreteProgram.pir_from_func_spec(
File "/opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages/decorator.py", line 232, in fun
return caller(func, *(extras + args), **kw)
File "/opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages/paddle/base/wrapped_decorator.py", line 40, in impl
return wrapped_func(*args, **kwargs)
File "/opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages/paddle/base/dygraph/base.py", line 101, in impl
return func(*args, **kwargs)
File "/opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages/paddle/jit/dy2static/program_translator.py", line 1276, in pir_from_func_spec
error_data.raise_new_exception()
File "/opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages/paddle/jit/dy2static/error.py", line 454, in raise_new_exception
raise new_exception from None
AssertionError: In transformed code:
复现环境 Environment
paddle 3.0.0beta
paddledetection 2.8
Bug描述确认 Bug description confirmation
是否愿意提交PR? Are you willing to submit a PR?
The text was updated successfully, but these errors were encountered: