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

maddpg NotImplementedError #962

Open universea opened 1 year ago

universea commented 1 year ago

在一个新环境里面跑maddpg,出现错误,NotImplementedError,看着是self.alg.sample(obs, use_target_model=use_target_model)这里有问题,这个怎么修改呀?

INFO:mlagents_envs.environment:Connected new brain: SoccerTwos?team=1 [INFO] Connected new brain: SoccerTwos?team=0 INFO:mlagents_envs.environment:Connected new brain: SoccerTwos?team=0 Observation Space: (336,)Action Space: Discrete(27) [10-03 01:02:05 MainThread @logger.py:242] Argv: c:/Users/ps/Documents/Academic/StudyInUofT/2022Fall/MIE1075/Soccer/soccer/train_soccer.py [10-03 01:02:08 MainThread @utils.py:73] paddlepaddle version: 2.3.2. <parl.algorithms.paddle.maddpg.MADDPG object at 0x000001D90DC15D60><parl.algorithms.paddle.maddpg.MADDPG object at 0x000001D90DC35880> <parl.algorithms.paddle.maddpg.MADDPG object at 0x000001D93DCCE4F0> <parl.algorithms.paddle.maddpg.MADDPG object at 0x000001D93DCE7160> Traceback (most recent call last): File "c:/Users/ps/Documents/Academic/StudyInUofT/2022Fall/MIE1075/Soccer/soccer/train_soccer.py", line 168, in <module> main() File "c:/Users/ps/Documents/Academic/StudyInUofT/2022Fall/MIE1075/Soccer/soccer/train_soccer.py", line 137, in main ep_reward, ep_agent_rewards, steps = run_episode(env, agents) File "c:/Users/ps/Documents/Academic/StudyInUofT/2022Fall/MIE1075/Soccer/soccer/train_soccer.py", line 59, in run_episode action_n = [agent.sample(obs_n[obs]) for agent, obs in zip(agents, obs_n)] File "c:/Users/ps/Documents/Academic/StudyInUofT/2022Fall/MIE1075/Soccer/soccer/train_soccer.py", line 59, in <listcomp> action_n = [agent.sample(obs_n[obs]) for agent, obs in zip(agents, obs_n)] File "c:\Users\ps\Documents\Academic\StudyInUofT\2022Fall\MIE1075\Soccer\soccer\simple_agent.py", line 63, in sample act = self.alg.sample(obs, use_target_model=use_target_model) File "C:\ProgramData\Anaconda3\envs\mie1075\lib\site-packages\parl\core\paddle\algorithm.py", line 79, in sample raise NotImplementedError NotImplementedError (mie1075) PS C:\Users\ps\Documents\Academic\StudyInUofT\2022Fall\MIE1075\Soccer\soccer>

rical730 commented 1 year ago

抱歉国庆后休假了未能及时回复,请问是运行examples里的MADDPG示例出现的问题吗?能否报一下操作系统版本、Python版本、Paddle和parl的版本呢?

universea commented 1 year ago

抱歉国庆后休假了未能及时回复,请问是运行examples里的MADDPG示例出现的问题吗?能否报一下操作系统版本、Python版本、Paddle和parl的版本呢?

找到问题了,直接pip insatll parl是这个问题,卸载之后,git下来 python setup 安装就可以了

rical730 commented 1 year ago

噢噢,应该是我们升级了MADDPG后,还未发布最新版的PARL,所以需要直接源码安装PARL才能运行现在仓库里的MADDPG,目前parl==2.0.5还不支持运行。可以像你这样直接把PARL仓库git clone下来,pip install . 来安装