PaddlePaddle / PARL

A high-performance distributed training framework for Reinforcement Learning
https://parl.readthedocs.io/
Apache License 2.0
3.22k stars 817 forks source link

科科老师的强化学习课程里面介绍的静态图方法的DQN代码运行过程中总是报错找不到agent类中的变量 #1074

Open Prememore opened 1 year ago

Prememore commented 1 year ago

pred_q = self.fluid_executor.run(self.pred_program, feed={'obs': obs.astype('float32')}, fetch_list=[self.value0])[0] 这一段代码在运行的时候总是报错: AttributeError: 'dqnagent' object has no attribute 'pred_program'. 这里的dqnagent是我的agent类名称; 如果把self.pred_program的声明不按照课件里面的放在build_program函数里,而是放在init下面,则报错: AttributeError: 'dqnagent' object has no attribute 'value'. 这是什么问题?静态图的建立中声明的self变量是无法识别的么?

TomorrowIsAnOtherDay commented 1 year ago

感谢你的反馈,麻烦提供下你的py版本、运行系统、以及parl版本。