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

跑quickstart的demo运行跑错 #1079

Closed Jasonzjj closed 1 year ago

Jasonzjj commented 1 year ago

运行代码: https://github.com/PaddlePaddle/PARL/tree/develop/examples/QuickStart

报错信息: [03-16 10:58:10 MainThread @logger.py:242] Argv: train.py [03-16 10:58:13 MainThread @train.py:84] obs_dim 4, act_dim 2 Traceback (most recent call last): File "/home/vdd/demo/train.py", line 125, in main() File "/home/vdd/demo/train.py", line 98, in main obs_list, action_list, reward_list = run_train_episode(agent, env) File "/home/vdd/demo/train.py", line 34, in run_train_episode action = agent.sample(obs) File "/home/vdd/demo/cartpole_agent.py", line 52, in sample prob = prob.numpy() AttributeError: 'NoneType' object has no attribute 'numpy'

其他信息: python3.9 parl2.2.1 paddlepaddle2.4.2 Linux version 4.14.0_1-0-0-43

TomorrowIsAnOtherDay commented 1 year ago
File "/home/vdd/demo/cartpole_agent.py", line 52, in sample
prob = prob.numpy()

hello,你有修改过代码吗? 我们quick start的代码里,52行不是sample函数。

https://github.com/PaddlePaddle/PARL/blob/c7040586e2c6152b0c8c30a55953009e773eabc1/examples/QuickStart/cartpole_agent.py#L52

Jasonzjj commented 1 year ago

没有修改,前面就是加了一些文件注释

Jasonzjj commented 1 year ago

对应这一行 image

TomorrowIsAnOtherDay commented 1 year ago

hello,我刚测试了下你的环境配置,是可以正常跑的,我的pip list如下:


Package                 Version
----------------------- ---------
absl-py                 1.4.0
astor                   0.8.1
cachetools              5.3.0
certifi                 2022.12.7
charset-normalizer      3.1.0
click                   8.1.3
cloudpickle             1.6.0
decorator               5.1.1
Flask                   2.2.3
Flask-Cors              3.0.10
google-auth             2.16.2
google-auth-oauthlib    0.4.6
grpcio                  1.37.0
gym                     0.26.2
gym-notices             0.0.8
idna                    3.4
importlib-metadata      6.0.0
itsdangerous            2.1.2
Jinja2                  3.1.2
Markdown                3.4.1
MarkupSafe              2.1.2
numpy                   1.24.2
oauthlib                3.2.2
opt-einsum              3.3.0
paddle-bfloat           0.1.7
paddlepaddle            2.4.2
parl                    2.2.1
Pillow                  9.4.0
pip                     23.0.1
protobuf                3.20.0
psutil                  5.9.4
pyasn1                  0.4.8
pyasn1-modules          0.2.8
pygame                  2.3.0
pynvml                  11.5.0
pyzmq                   22.3.0
requests                2.28.2
requests-oauthlib       1.3.1
rsa                     4.9
scipy                   1.10.1
setuptools              65.6.3
six                     1.16.0
tensorboard             2.11.0
tensorboard-data-server 0.6.1
tensorboard-plugin-wit  1.8.1
tensorboardX            2.5
termcolor               2.2.0
urllib3                 1.26.15
Werkzeug                2.2.3
wheel                   0.38.4
zipp                    3.15.0
Jasonzjj commented 1 year ago

已解决,多谢