PaddlePaddle / PARL

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

AI Studio 运行 DQN例程报错 #953

Open ilovegaoyuan opened 1 year ago

ilovegaoyuan commented 1 year ago

在AI Studio 的脚本模式运行DQN例程报错 我在run.py中重新安装依赖库 import os import train myCmd = 'pip uninstall -y parl' os.system(myCmd) myCmd = 'pip uninstall -y gym' os.system(myCmd) myCmd = 'pip uninstall -y pandas scikit-learn' os.system(myCmd) myCmd = 'pip install gym' os.system(myCmd) myCmd = 'pip install parl' os.system(myCmd) myCmd = 'pip list --format=columns' os.system(myCmd) train.main()

但执行失败。例程代码在我个人电脑上运行没有问题,所以想问是不是AISTUDIO的配置有些问题呢? Traceback (most recent call last): File "run.py", line 58, in train.main() File "/mnt/code_20220901113948/train.py", line 78, in main env = gym.make('CartPole-v0') File "/opt/_internal/cpython-3.7.0/lib/python3.7/site-packages/gym/envs/registration.py", line 183, in make def _check_name_exists(ns: Optional[str], name: str): File "/opt/_internal/cpython-3.7.0/lib/python3.7/site-packages/gym/envs/registration.py", line 125, in make

TomorrowIsAnOtherDay commented 1 year ago

hello,看起来像是gym版本的问题,你确认下本地的gym版本和aistudio上的版本,看下是否一致。

ilovegaoyuan commented 1 year ago

hello,看起来像是gym版本的问题,你确认下本地的gym版本和aistudio上的版本,看下是否一致。 @TomorrowIsAnOtherDay hi,按照您的指点我查看了gym版本 aistudio的gym和我本地的gym版本是一样的 都是0.25.2 parl都是2.0.5 我之前用我自己按照example改的程序会报找不到DQN的错误,所以我在想是不是我的AISTUDIO的操作哪里有问题 DQN例程的AISTUDIO项目地址 https://aistudio.baidu.com/aistudio/clusterprojectdetail/4482076

rical730 commented 1 year ago

Hi,你可以尝试在运行 python train.py 之前执行以下安装操作

pip install gym==0.18.0
pip install paddlepaddle==2.3.1
pip install parl==2.0.5

python train.py

或者也可以体验一下我们整理的AIStudio例程(DQN解决CartPole问题) https://aistudio.baidu.com/aistudio/projectdetail/4375697

rical730 commented 1 year ago

推荐使用gym版本 gym==0.18.0