-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Conversation
shiyutang
commented
Mar 24, 2022
- Add docs about set input_shape.
- Add cityscape_val.list to decrease the infer time of enet.
一次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 保持一致 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
如果deploy.yml的transform可以保证输入图片尺寸一样也是可以的。『此处的图片大小』写得有点模糊,到底是哪处呢
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bisenet模型导出为什么要固定shape呢
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个是通过示例说明固定输入尺寸的方式,不代表bisenet需要固定
docs/model_export_cn.md
Outdated
@@ -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 | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
改成 如果预测shape固定,建议指定input_shape参数
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
test_tipc/prepare.sh
Outdated
@@ -75,3 +75,7 @@ else | |||
|
|||
fi | |||
fi | |||
|
|||
if [ ${model_name} == "enet" ];then | |||
mv ./test_tipc/data/cityscapes_val_5.list ./test_tipc/data/cityscapes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mv改成cp
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
训练、评估、导出都比较快,单个 infer 时间2.5分钟。 |
整个流程还包括多个cpu infer和gpu infer,看下整体耗时满不满足15min把 |
cpu infer比较慢,gpu快很多 |