Skip to content
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

ppliteseg模型问题 #3772

Closed
1 task done
chengjingxiang opened this issue Aug 7, 2024 · 9 comments
Closed
1 task done

ppliteseg模型问题 #3772

chengjingxiang opened this issue Aug 7, 2024 · 9 comments
Assignees
Labels
question Further information is requested

Comments

@chengjingxiang
Copy link

问题确认 Search before asking

  • 我已经搜索过问题,但是没有找到解答。I have searched the question and found no related answer.

请提出你的问题 Please ask your question

我在使用瑞芯微宇训练模型,导出onnx为
image
但是我使用教程训练出的PP_LiteSeg_T_STDC1_cityscapes为
image
现在我想和预训练模型一致该怎么办,我使用的配置文件为configs/pp_liteseg/pp_liteseg_stdc1_cityscapes_1024x512_scale0.5_160k.yml,版本信息为2.9.1

@chengjingxiang chengjingxiang added the question Further information is requested label Aug 7, 2024
@zhang-prog
Copy link
Collaborator

我在使用瑞芯微宇训练模型 这好像不是paddleseg所提供的吧,如果是paddleseg提供的麻烦提供下地址。

@zhang-prog
Copy link
Collaborator

另外我这边使用你提供的配置文件导出的模型结构和第一张图片一样,你检查下是否是你训练过程中有变动。
infoflow 2024-08-08 19-37-39

@chengjingxiang
Copy link
Author

你导出模型使用的命令是python tools/export.py
--config configs/pp_liteseg/pp_liteseg_stdc1_cityscapes_1024x512_scale0.5_160k.yml
--model_path output/model.pdparams
--save_dir output/inference_model

@zhang-prog
Copy link
Collaborator

是的,然后再使用paddle2onnx导出onnx即可。如果按配置文件训练的PP_LiteSeg网络结构应该是一样的,可以再看下你训练过程中哪里有偏差。

@chengjingxiang
Copy link
Author

可我按着这个导出配置为---------------Deploy Information---------------
Deploy:
input_shape:

  • -1
  • 3
  • -1
  • -1
    model: model.pdmodel
    output_dtype: int32
    output_op: argmax
    params: model.pdiparams
    transforms:
  • type: Normalize

2024-08-09 15:31:03 [INFO] The inference model is saved in output/inference_model,再转onnx时则报错[Paddle2ONNX] Start to parse PaddlePaddle model...
[Paddle2ONNX] Model file path: output/inference_model/model.pdmodel
[Paddle2ONNX] Parameters file path: output/inference_model/model.pdiparams
[Paddle2ONNX] Start to parsing Paddle model...
[ERROR][Paddle2ONNX] [pool2d: pool2d_4.tmp_0] Adaptive only support static input shape.
[Paddle2ONNX] Due to the operator: pool2d, this model cannot be exported to ONNX.
[ERROR][Paddle2ONNX] [pool2d: pool2d_5.tmp_0] Adaptive only support static input shape.
[Paddle2ONNX] Due to the operator: pool2d, this model cannot be exported to ONNX.
[ERROR] Model exporting failed, you can report this problem to https://github.com/PaddlePaddle/Paddle2ONNX.git.

@zhang-prog
Copy link
Collaborator

输入没固定,export的时候加下 --input_shape
python tools/export.py
--config configs/pp_liteseg/pp_liteseg_stdc1_cityscapes_1024x512_scale0.5_160k.yml
--model_path output/model.pdparams
--save_dir output/inference_model
--input_shape 1 3 1024 512

@chengjingxiang
Copy link
Author

添加input模型在附件中,和之前的模型又不一致了,下面是我导出的onnx的结构截图
2024-08-09 15-55-12屏幕截图
2024-08-09 15-56-16屏幕截图

@chengjingxiang
Copy link
Author

完整模型结构如下
screencapture-netron-app-2024-08-09-16_14_48

@zhang-prog
Copy link
Collaborator

如果想利用预训练模型进行微调(finetune),可以在配置文件中添加model.pretained字段,内容为预训练模型权重文件的URL地址或本地路径。PaddleSeg提供基于Cityscapes、ADE20K等公开数据集的预训练模型,可以在PaddleSeg/configs下面不同模型的页面中获取下载链接。

直接按 docs/train/train_cn.md 的流程来,别做其他修改,目前我不清楚你实际流程,没办法给更详细的回答哈。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants