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

[Fix] Fix Enet export and infer problem. #1919

Merged
merged 5 commits into from
Mar 29, 2022
Merged

[Fix] Fix Enet export and infer problem. #1919

merged 5 commits into from
Mar 29, 2022

Conversation

shiyutang
Copy link
Collaborator

  • Add docs about set input_shape.
  • Add cityscape_val.list to decrease the infer time of enet.

@shiyutang
Copy link
Collaborator Author

The inference time is as follows by running prepare.sh and test_train_infer_python.sh
A4 Interene feafes) 3e1t2 m2,

@LutaoChu
Copy link
Contributor

一次cpu预测就要2.5min,整个lite_train_lite_infer跑下来需要多长时间呢?会不会超过15min呢?

@@ -16,7 +16,7 @@

在终端输入以下命令进行预测:
```shell
python deploy/python/infer.py --config /path/to/deploy.yaml --image_path
python deploy/python/infer.py --config /path/to/deploy.yaml --image_path # 如果导出指定了input_shape, 此处的图片大小需要和 input_shape 保持一致
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

如果deploy.yml的transform可以保证输入图片尺寸一样也是可以的。『此处的图片大小』写得有点模糊,到底是哪处呢

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -30,6 +30,7 @@ python export.py \
--config configs/bisenet/bisenet_cityscapes_1024x1024_160k.yml \
--model_path bisenet/model.pdparams\
--save_dir output
--input_shape 1 3 512 1024
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bisenet模型导出为什么要固定shape呢

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个是通过示例说明固定输入尺寸的方式,不代表bisenet需要固定

@@ -38,10 +39,12 @@ python export.py \
|config|配置文件|是|-|
|model_path|预训练权重的路径|否|配置文件中指定的预训练权重路径|
|save_dir|保存预测模型的路径|否|output|
|input_shape| 设置导出模型的输入shape,比如传入`--input_shape 1 3 1024 1024`。如果不设置input_shape,默认导出模型的输入shape是[-1, 3, -1, -1] | 否 | None |
|input_shape| 设置导出模型的输入shape,比如传入`--input_shape 1 3 1024 1024`。如果不设置input_shape,默认导出模型的输入shape是[-1, 3, -1, -1] | 否(最好指定) | None |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

改成 如果预测shape固定,建议指定input_shape参数

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -75,3 +75,7 @@ else

fi
fi

if [ ${model_name} == "enet" ];then
mv ./test_tipc/data/cityscapes_val_5.list ./test_tipc/data/cityscapes
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mv改成cp

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@shiyutang
Copy link
Collaborator Author

训练、评估、导出都比较快,单个 infer 时间2.5分钟。

@shiyutang shiyutang requested a review from LutaoChu March 25, 2022 09:32
@LutaoChu
Copy link
Contributor

训练、评估、导出都比较快,单个 infer 时间2.5分钟。

整个流程还包括多个cpu infer和gpu infer,看下整体耗时满不满足15min把

@LutaoChu
Copy link
Contributor

训练、评估、导出都比较快,单个 infer 时间2.5分钟。

整个流程还包括多个cpu infer和gpu infer,看下整体耗时满不满足15min把

cpu infer比较慢,gpu快很多

@LutaoChu LutaoChu closed this Mar 28, 2022
@LutaoChu LutaoChu reopened this Mar 28, 2022
@shiyutang
Copy link
Collaborator Author

根据日志,训练到最后一次预测,一共耗时十分钟:
image
image

@LutaoChu LutaoChu merged commit c51e0e1 into PaddlePaddle:develop Mar 29, 2022
@shiyutang shiyutang deleted the develop branch April 6, 2022 09:03
@shiyutang shiyutang restored the develop branch April 12, 2022 06:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants