gym/core.py报错:raise NotImplementedError
使用环境:
在使用代码ERL_2018时,出现上述问题。
原因分析:
代码老旧,原代码使用的gym版本很老。
解决方法:
1.将gym版本改为:gym==0.15.6
2.将代码中使用的_step
改为step
,参考下面程序。
class NormalizedActions(gym.ActionWrapper):
def _action(self, action):
action = (action + 1) / 2 # [-1, 1] => [0, 1]
action *= (self.action_space.high - self.action_space.low)
action += self.action_space.low
return action
def _reverse_action(self, action):
action -= self.action_space.low
action /= (self.action_space.high - self.action_space.low)
action = action * 2 - 1
return action