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

模型转为serving时报错要enable_static,怎么解决 #1060

Closed
guojiahuiEmily opened this issue Feb 22, 2021 · 3 comments
Closed

模型转为serving时报错要enable_static,怎么解决 #1060

guojiahuiEmily opened this issue Feb 22, 2021 · 3 comments
Assignees

Comments

@guojiahuiEmily
Copy link

python -m paddle_serving_client.convert --dirname . --model_filename dygraph_model.pdmodel --params_filename dygraph_model.pdiparams --serving_server serving_server --serving_client serving_client
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 174, in _run_module_as_main

AssertionError: In PaddlePaddle 2.x, we turn on dynamic graph mode by default, and 'load_inference_model()' is only supported in static graph mode. So if you want to use this api, please call 'paddle.enable_static()' before this api to enter static graph mode.

@TeslaZhao
Copy link
Collaborator

您使用的是v0.5.0版本或develop分支吗

@muyu1944
Copy link

muyu1944 commented Mar 2, 2021

@TeslaZhao pipeline是不是还不支持部署0.5.0版的serving转换的模型?
log里显示:failed to init op: (Unavailable) Load operator fail to open file serving_server/layer_norm_17.w_0, please check whether the model file is complete or damaged.

@HexToString
Copy link
Collaborator

您可以试试在转换代码中加入
paddle.enable_static()

另外,若代码中直接或间接用到了,save_inference_model这个函数,需要注意这个函数中的参数'params'。
当'params'没有值时,默认你的模型参数是离散的(多个模型参数问题)
当'params' = "params",则你的模型参数是聚合的。

@paddle-bot paddle-bot bot closed this as completed Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants