Paddle Inference python能推理,像使用mkldnn功能,但是报错

o4tp2gmn  于 2022-10-25  发布在  Python
关注(0)|答案(6)|浏览(608)

使用python接口进行推理,通过config.enable_mkldnn()配置
报如下错误:

python3 python_demo.py --model_file ./resnet50/inference.pdmodel --params_file ./resnet50/inference.pdiparams --batch_size 2
E0106 23:22:01.993271 338939392 analysis_config.cc:306] Please compile with MKLDNN first to use MKLDNN
False
Traceback (most recent call last):
File "python_demo.py", line 72, in
main()
File "python_demo.py", line 19, in main
config.set_mkldnn_cache_capacity(1)
AttributeError: 'paddle.fluid.core_avx.AnalysisConfig' object has no attribute 'set_mkldnn_cache_capacity'

我理解安装了飞桨框架,不是就能跑飞桨推理吗?
我电脑环境:
Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz

0tdrvxhp

0tdrvxhp1#

您好,我们已经收到了您的问题,会安排技术人员尽快解答您的问题,请耐心等待。请您再次检查是否提供了清晰的问题描述、复现代码、环境&版本、报错信息等。同时,您也可以通过查看 官网API文档常见问题历史IssueAI社区 来寻求解答。祝您生活愉快~

Hi! We've received your issue and please be patient to get responded. We will arrange technicians to answer your questions as soon as possible. Please make sure that you have posted enough message to demo your request. You may also check out the APIFAQGithub Issue and AI community to get the answer.Have a nice day!

ifsvaxew

ifsvaxew2#

您好,请问使用的 Paddle 版本是? 能否提供最小可复现环境?

mi7gmzs6

mi7gmzs64#

不过目前没有mac支持mkl的库

yws3nbqq

yws3nbqq5#

我已在 jetson xavier NX 上安装推理框架Jetpack4.4(4.5): nv_jetson-cuda10.2-trt7-xavier, (paddle v2.2.1) 但是依旧获得AttributeError: 'paddle.fluid.core_noavx.AnalysisConfig' object has no attribute 'set_mkldnn_cache_capacity'. 请问这是什么原因?

egdjgwm8

egdjgwm86#

我也遇到同样的问题,版本 paddle v2.3.1
我是用的 PaddleRs 官方教程 classification/resnet50_vd 训练后推理出现 Warning 。

2022-07-23 18:20:44 [WARNING]   The current environment does not support MKL-DNN, MKL-DNN is disabled.

https://github.com/PaddlePaddle/PaddleRS/blob/05e1eeee6eb7a31ef5e1299f32f09b067e2f7e85/paddlers/deploy/predictor.py#L129-L138

@tianxin1860
您好,请问使用的 Paddle 版本是? 能否提供最小可复现环境?

安装 EISeg 启动时就会报错

E0723 18:25:37.643397 204861440 analysis_config.cc:389] Please compile with MKLDNN first to use MKLDNN
--- Running analysis [ir_graph_build_pass]
--- Running analysis [ir_graph_clean_pass]
--- Running analysis [ir_analysis_pass]

Paddle/paddle/fluid/inference/api/analysis_config.cc

Lines 426 to 435 in 6b6f7a2

| | voidAnalysisConfig::EnableMKLDNN() { |
| | #ifdef PADDLE_WITH_MKLDNN |
| | use_mkldnn_ = true; |
| | #else |
| | LOG(ERROR) << "Please compile with MKLDNN first to use MKLDNN"; |
| | use_mkldnn_ = false; |
| | #endif |
| | |
| | Update(); |
| | } |

是不是 mac 版本编译的时候就没开启 PADDLE_WITH_MKLDNN ,不支持 mkldnn ?

相关问题