boyu-ai / Hands-on-RL

https://hrl.boyuai.com/
Apache License 2.0
2.18k stars 497 forks source link

20章的代码问题 #60

Open Wayne857 opened 9 months ago

Wayne857 commented 9 months ago
image

你好,请问这种情况怎么解决呢?是20章的代码问题

CorneliusDeng commented 9 months ago

请问你在最开始加载ma-gym环境时遇到了这个问题吗?

{ "name": "AttributeError", "message": "'EnvSpec' object has no attribute 'entry_point'", "stack": "--------------------------------------------------------------------------- AttributeError Traceback (most recent call last) /Users/corneliusdeng/UESTC/Dive Into RL/IPPO.ipynb Cell 1 line 1 9 import sys 10 sys.path.append(\"./ma-gym\") ---> 11 from ma_gym.envs.combat.combat import Combat

File ~/UESTC/Dive Into RL/./ma-gym/ma_gym/init.py:10 6 logger = logging.getLogger(name) 8 # Register openai's environments as multi agent 9 # This should be done before registering new environments ---> 10 env_specs = [env_spec for env_spec in envs.registry.all() if 'gym.envs' in env_spec.entry_point] 11 for spec in envspecs: 12 register( 13 id='ma' + spec.id, 14 entry_point='ma_gym.envs.openai:MultiAgentWrapper', 15 kwargs={'name': spec.id, **spec._kwargs} 16 )

File ~/UESTC/Dive Into RL/./ma-gym/ma_gym/init.py:10, in (.0) 6 logger = logging.getLogger(name) 8 # Register openai's environments as multi agent 9 # This should be done before registering new environments ---> 10 env_specs = [env_spec for env_spec in envs.registry.all() if 'gym.envs' in env_spec.entry_point] 11 for spec in envspecs: 12 register( 13 id='ma' + spec.id, 14 entry_point='ma_gym.envs.openai:MultiAgentWrapper', 15 kwargs={'name': spec.id, **spec._kwargs} 16 )

AttributeError: 'EnvSpec' object has no attribute 'entry_point'" }

Wayne857 commented 9 months ago

请问你在最开始加载ma-gym环境时遇到了这个问题吗?

{ "name": "AttributeError", "message": "'EnvSpec' object has no attribute 'entry_point'", "stack": "--------------------------------------------------------------------------- AttributeError Traceback (most recent call last) /Users/corneliusdeng/UESTC/Dive Into RL/IPPO.ipynb Cell 1 line 1 9 import sys 10 sys.path.append("./ma-gym") ---> 11 from ma_gym.envs.combat.combat import Combat

File ~/UESTC/Dive Into RL/./ma-gym/ma_gym/init.py:10 6 logger = logging.getLogger(name) 8 # Register openai's environments as multi agent 9 # This should be done before registering new environments ---> 10 env_specs = [env_spec for env_spec in envs.registry.all() if 'gym.envs' in env_spec.entry_point] 11 for spec in envspecs: 12 register( 13 id='ma' + spec.id, 14 entry_point='ma_gym.envs.openai:MultiAgentWrapper', 15 kwargs={'name': spec.id, **spec._kwargs} 16 )

File ~/UESTC/Dive Into RL/./ma-gym/ma_gym/init.py:10, in (.0) 6 logger = logging.getLogger(name) 8 # Register openai's environments as multi agent 9 # This should be done before registering new environments ---> 10 env_specs = [env_spec for env_spec in envs.registry.all() if 'gym.envs' in env_spec.entry_point] 11 for spec in envspecs: 12 register( 13 id='ma' + spec.id, 14 entry_point='ma_gym.envs.openai:MultiAgentWrapper', 15 kwargs={'name': spec.id, **spec._kwargs} 16 )

AttributeError: 'EnvSpec' object has no attribute 'entry_point'" }

你好,我在加载的时候没有问题,是图片中那里出现的问题

Thom1345622974 commented 5 months ago

你好 请问keyerror这个问题是怎么解决的呀 我也遇到这个问题了