Paddle API文档例子代码错误

kknvjkwl  于 2022-11-05  发布在  其他
关注(0)|答案(2)|浏览(155)

bug描述 Describe the Bug

https://www.paddlepaddle.org.cn/documentation/docs/en/develop/api/paddle/profiler/Profiler_en.html

中例子1、2、的p.step()执行。第一次可以有log文件,第二次就报错:

AttributeError Traceback (most recent call last)
/tmp/ipykernel_168/153734649.py in
8 #train()
----> 9 p.step()

/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/profiler/profiler.py in step(self, num_samples)
575 self.current_state = self.scheduler(self.step_num)
--> 576 self._trigger_action()
577 self.record_event = RecordEvent(

/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/profiler/profiler.py in _trigger_action(self)
631 if self.current_state == ProfilerState.READY: # CLOSED -> READY
--> 632 self.profiler.prepare()
633 if self.current_state == ProfilerState.RECORD: # CLOSED -> RECORD

AttributeError: 'NoneType' object has no attribute 'prepare'

During handling of the above exception, another exception occurred:

AttributeError Traceback (most recent call last)
/tmp/ipykernel_168/153734649.py in
7 for iter in range(10):
8 #train()
----> 9 p.step()

/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/profiler/profiler.py inexit(self, exc_type, exc_val, exc_tb)
455
456 defexit(self, exc_type, exc_val, exc_tb):
--> 457 self.stop()
458
459 def start(self):

/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/profiler/profiler.py in stop(self)
531 "Inproper Profiler state transform: READY->CLOSED, profiler will start and stop without saving data"
532 )
--> 533 self.profiler.start()
534 self.profiler.stop()
535 if self.current_state == ProfilerState.RECORD or self.current_state == ProfilerState.RECORD_AND_RETURN:

AttributeError: 'NoneType' object has no attribute 'start'

其他补充信息 Additional Supplementary Information

  • No response*
kxe2p93d

kxe2p93d1#

您好,我们已经收到了您的问题,会安排技术人员尽快解答您的问题,请耐心等待。请您再次检查是否提供了清晰的问题描述、复现代码、环境&版本、报错信息等。同时,您也可以通过查看 官网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!

mspsb9vt

mspsb9vt2#

请提供具体的 Paddle 版本号及运行环境。

相关问题