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

offline_run.py中_check_obs_action_space_info方法有误 #20

Open
libermeng opened this issue Sep 3, 2024 · 0 comments
Open

offline_run.py中_check_obs_action_space_info方法有误 #20

libermeng opened this issue Sep 3, 2024 · 0 comments

Comments

@libermeng
Copy link

执行离线测试代码时报错如下:

(RL) liber@DESKTOP-HJ34P4I D:\Projects\joyrl>python offline_run.py --yaml presets/ClassControl/CartPole-v1/CartPole-v1_DQN.yaml
2024-09-03 10:35:53,380 INFO worker.py:1612 -- Started a local Ray instance. View the dashboard at 127.0.0.1:8265 
Traceback (most recent call last):
  File "D:\Projects\joyrl\offline_run.py", line 240, in <module>
    launcher.run()
  File "D:\Projects\joyrl\offline_run.py", line 229, in run
    self._check_obs_action_space_info(env)
  File "D:\Projects\joyrl\offline_run.py", line 217, in _check_obs_action_space_info
    action_type_list, action_size_list = self._check_obs_action_space_info(env)
  File "D:\Projects\joyrl\offline_run.py", line 217, in _check_obs_action_space_info
    action_type_list, action_size_list = self._check_obs_action_space_info(env)
  File "D:\Projects\joyrl\offline_run.py", line 217, in _check_obs_action_space_info
    action_type_list, action_size_list = self._check_obs_action_space_info(env)
  [Previous line repeated 991 more times]
  File "D:\Projects\joyrl\offline_run.py", line 216, in _check_obs_action_space_info
    self.cfg.obs_space_info = ObsSpaceInfo(size = state_size_list, type = state_type_list)
  File "D:\Projects\joyrl\joyrl\framework\core_types.py", line 78, in __init__
    self._check_type_size()
  File "D:\Projects\joyrl\joyrl\framework\core_types.py", line 81, in _check_type_size
    assert len(self.type) == len(self.size), 'obs type and size must have the same length'
RecursionError: maximum recursion depth exceeded while calling a Python object

经检查发现定义了两个_check_obs_action_space_info方法,将第二个方法改成_check_obs_state_space_info,同时修改run方法中self._check_obs_action_space_info(env)为self._check_obs_state_space_info(env)之后问题解决。

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

1 participant