Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

20章的代码问题 #60

Open
Wayne857 opened this issue Oct 12, 2023 · 3 comments
Open

20章的代码问题 #60

Wayne857 opened this issue Oct 12, 2023 · 3 comments

Comments

@Wayne857
Copy link

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

请问你在最开始加载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 env_specs:
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 env_specs:
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
Copy link
Author

请问你在最开始加载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 env_specs: 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 env_specs: 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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants