PaddlePaddle / Paddle

PArallel Distributed Deep LEarning: Machine Learning Framework from Industrial Practice (『飞桨』核心框架,深度学习&机器学习高性能单机、分布式训练和跨平台部署)
http://www.paddlepaddle.org/
Apache License 2.0
22.09k stars 5.55k forks source link

We only support 'data()' in static graph mode....... #28493

Closed python-bookworm closed 2 years ago

python-bookworm commented 3 years ago

在运行训练程序时候,报错: AssertionError: We only support 'data()' in static graph mode, please call 'paddle.enable_static()' to enter static graph mode 按照#27495问题的方案,并没有解决问题,运行 主机环境:ubuntu18.04,cuda10.0,cudnn7.5,paddlepaddle-gpu==2.0 请教下是什么问题导致报错?

paddle-bot-old[bot] commented 3 years ago

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

Hi! We've received your issue and please be patient to get responded.The average response time is expected to be with in one day.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!

lfchener commented 3 years ago

paddle 2.0-rc 以后默认开启动态图模式,您的模型如果是使用静态图实现的话,请在代码前显示调用 paddle.enable_static() 开启静态图模式,再运行。

python-bookworm commented 3 years ago

paddle 2.0-rc 以后默认开启动态图模式,您的模型如果是使用静态图实现的话,请在代码前显示调用 paddle.enable_static() 开启静态图模式,再运行。

好的,已经加了静态开启的模式,可以正常运行,谢谢。

smartmark-pro commented 3 years ago

@lfchener 我遇到了类似的报错, 我是用来调用bertservice的, 使用的命令是

hub serving start bert_service -m roberta_wwm_ext_chinese_L-24_H-1024_A-16--use_gpu --gpu 0 --port 8866

环境信息

如果当前无法使用, 切换低于2.0版本的paddlepaddle-gpu就行了么

smartmark-pro commented 3 years ago

@lfchener 我遇到了类似的报错, 我是用来调用bertservice的, 使用的命令是

hub serving start bert_service -m roberta_wwm_ext_chinese_L-24_H-1024_A-16--use_gpu --gpu 0 --port 8866

环境信息

  • paddlehub 1.8.3
  • paddlepaddle-gpu 2.0.0rc0.post101

如果当前无法使用, 切换低于2.0版本的paddlepaddle-gpu就行了么

换低版本没什么问题, 不考虑该问题了

paddle-bot-old[bot] commented 2 years ago

Since you haven\'t replied for more than a year, we have closed this issue/pr. If the problem is not solved or there is a follow-up one, please reopen it at any time and we will continue to follow up. 由于您超过一年未回复,我们将关闭这个issue/pr。 若问题未解决或有后续问题,请随时重新打开,我们会继续跟进。