agi-brain / xuance

XuanCe: A Comprehensive and Unified Deep Reinforcement Learning Library
https://xuance.readthedocs.io/
MIT License
648 stars 106 forks source link

AttributeError: accessing private attribute '_max_episode_steps' is prohibited #12

Closed seuteer closed 6 months ago

seuteer commented 12 months ago

您好,这是版本不兼容的问题吗?

A.L.E: Arcade Learning Environment (version 0.8.1+53f58b7) [Powered by Stella] D:\Anaconda\envs\pycarla\lib\site-packages\gym\utils\passive_env_checker.py:32: UserWarning: WARN: A Box observation space has an unconventional shape (neither an image, nor a 1D vector). We recommend flattening the observation to have only a 1D vector or use a custom policy to properly process the data. Actual observation shape: (210, 160) "A Box observation space has an unconventional shape (neither an image, nor a 1D vector). " Traceback (most recent call last): File "D:\CODE\TrafficBigData\ReinforcementLearning\xuance-master\test.py", line 7, in is_test=False) File "D:\CODE\TrafficBigData\ReinforcementLearning\xuance-master\xuance\common\common_tools.py", line 166, in get_runner runner = run_REGISTRYargs[0].runner if type(args) == list else run_REGISTRYargs.runner File "D:\CODE\TrafficBigData\ReinforcementLearning\xuance-master\xuance\torch\runners\runner_drl.py", line 21, in init super(Runner_DRL, self).init(self.args) File "D:\CODE\TrafficBigData\ReinforcementLearning\xuance-master\xuance\torch\runners\runner_basic.py", line 11, in init self.envs = make_envs(args) File "D:\CODE\TrafficBigData\ReinforcementLearning\xuance-master\xuance\environment__init.py", line 68, in make_envs return REGISTRY_VEC_ENV[config.vectorize]([thunk for in range(config.parallels)]) File "D:\CODE\TrafficBigData\ReinforcementLearning\xuance-master\xuance\environment\gym\gym_vec_env.py", line 233, in init super(DummyVecEnv_Atari, self).init(env_fns) File "D:\CODE\TrafficBigData\ReinforcementLearning\xuance-master\xuance\environment\gym\gym_vec_env.py", line 158, in init self.envs = [fn() for fn in env_fns] File "D:\CODE\TrafficBigData\ReinforcementLearning\xuance-master\xuance\environment\gym\gym_vec_env.py", line 158, in self.envs = [fn() for fn in env_fns] File "D:\CODE\TrafficBigData\ReinforcementLearning\xuance-master\xuance\environment__init__.py", line 58, in _thunk config.obs_type, config.frame_skip, config.num_stack, config.img_size, config.noop_max) File "D:\CODE\TrafficBigData\ReinforcementLearning\xuance-master\xuance\environment\gym\gym_env.py", line 123, in init__ self.max_episode_length = self.env._max_episode_steps File "D:\Anaconda\envs\pycarla\lib\site-packages\gym\core.py", line 240, in getattr raise AttributeError(f"accessing private attribute '{name}' is prohibited") AttributeError: accessing private attribute '_max_episode_steps' is prohibited

wenzhangliu commented 12 months ago

你好,看到了你的问题描述,应该是在文件 "D:\CODE\TrafficBigData\ReinforcementLearning\xuance-master\xuance\environment\gym\gym_env.py" 第123行执行self.max_episode_length = self.env._max_episode_steps时出错, 很有可能是gym[atari]的版本不一样导致,请查看一下xuance/setup.py文件中关于各Python包的版本号,建议按照对应的版本号安装。

感谢您的使用,如有其他问题,欢迎随时联系。


玄策官方

------------------ 原始邮件 ------------------ 发件人: "agi-brain/xuance" @.>; 发送时间: 2023年11月22日(星期三) 晚上10:45 @.>; @.***>; 主题: [agi-brain/xuance] AttributeError: accessing private attribute '_max_episode_steps' is prohibited (Issue #12)

您好,这是版本不兼容的问题吗?

A.L.E: Arcade Learning Environment (version 0.8.1+53f58b7) [Powered by Stella] D:\Anaconda\envs\pycarla\lib\site-packages\gym\utils\passive_env_checker.py:32: UserWarning: WARN: A Box observation space has an unconventional shape (neither an image, nor a 1D vector). We recommend flattening the observation to have only a 1D vector or use a custom policy to properly process the data. Actual observation shape: (210, 160) "A Box observation space has an unconventional shape (neither an image, nor a 1D vector). " Traceback (most recent call last): File "D:\CODE\TrafficBigData\ReinforcementLearning\xuance-master\test.py", line 7, in is_test=False) File "D:\CODE\TrafficBigData\ReinforcementLearning\xuance-master\xuance\common\common_tools.py", line 166, in get_runner runner = run_REGISTRYargs[0].runner if type(args) == list else run_REGISTRYargs.runner File "D:\CODE\TrafficBigData\ReinforcementLearning\xuance-master\xuance\torch\runners\runner_drl.py", line 21, in init super(Runner_DRL, self).init(self.args) File "D:\CODE\TrafficBigData\ReinforcementLearning\xuance-master\xuance\torch\runners\runner_basic.py", line 11, in init self.envs = make_envs(args) File "D:\CODE\TrafficBigData\ReinforcementLearning\xuance-master\xuance\environmentinit.py", line 68, in make_envs return REGISTRY_VECENV[config.vectorize]([thunk for in range(config.parallels)]) File "D:\CODE\TrafficBigData\ReinforcementLearning\xuance-master\xuance\environment\gym\gym_vec_env.py", line 233, in init super(DummyVecEnv_Atari, self).init(env_fns) File "D:\CODE\TrafficBigData\ReinforcementLearning\xuance-master\xuance\environment\gym\gym_vec_env.py", line 158, in init self.envs = [fn() for fn in env_fns] File "D:\CODE\TrafficBigData\ReinforcementLearning\xuance-master\xuance\environment\gym\gym_vec_env.py", line 158, in self.envs = [fn() for fn in env_fns] File "D:\CODE\TrafficBigData\ReinforcementLearning\xuance-master\xuance\environment_init.py", line 58, in _thunk config.obs_type, config.frame_skip, config.num_stack, config.img_size, config.noop_max) File "D:\CODE\TrafficBigData\ReinforcementLearning\xuance-master\xuance\environment\gym\gym_env.py", line 123, in init self.max_episode_length = self.env._max_episode_steps File "D:\Anaconda\envs\pycarla\lib\site-packages\gym\core.py", line 240, in getattr raise AttributeError(f"accessing private attribute '{name}' is prohibited") AttributeError: accessing private attribute '_max_episode_steps' is prohibited

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>

seuteer commented 12 months ago

谢谢您的回复,问题已经解决了