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

NotImplementedError #13

Open
ashing-zhang opened this issue Nov 18, 2021 · 2 comments
Open

NotImplementedError #13

ashing-zhang opened this issue Nov 18, 2021 · 2 comments

Comments

@ashing-zhang
Copy link

Traceback (most recent call last):
File "D:\Master\Codes\pytorch-ddpg\main.py", line 156, in
train(args.train_iter, agent, env, evaluate,
File "D:\Master\Codes\pytorch-ddpg\main.py", line 44, in train
observation2, reward, done, info = env.step(action)
File "D:\AI\Software\Conda\Miniconda\envs\torch\lib\site-packages\gym\core.py", line 349, in step
return self.env.step(self.action(action))
File "D:\AI\Software\Conda\Miniconda\envs\torch\lib\site-packages\gym\core.py", line 353, in action
raise NotImplementedError
NotImplementedError

@fuhaiwang
Copy link

You can change the code line#126 in main.py:
from
env = NormalizedEnv(gym.make(args.env))
to
env = gym.make(args.env)

Or you can do:
change the code line#8 and line#13 in normalized_env.py:
from
def _action(self, action): and def _reverse_action(self, action):
to
def action(self, action): and def reverse_action(self, action):

Because the gym is updated (Maybe?). The function in class NormalizedEnv should delete "_". You can see the father class ActionWrapper in https://github.com/openai/gym/blob/master/gym/core.py

That's all!

@ashing-zhang
Copy link
Author

ashing-zhang commented Nov 26, 2021 via email

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

2 participants