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

AttributeError: 'MultiDiscrete' object has no attribute 'low' #852

Open
6 of 11 tasks
Rocky-CN opened this issue Jan 11, 2025 · 0 comments
Open
6 of 11 tasks

AttributeError: 'MultiDiscrete' object has no attribute 'low' #852

Rocky-CN opened this issue Jan 11, 2025 · 0 comments

Comments

@Rocky-CN
Copy link

Rocky-CN commented Jan 11, 2025

  • I have marked all applicable categories:
    • exception-raising bug
    • RL algorithm bug
    • system worker bug
    • system utils bug
    • code design/refactor
    • documentation request
    • new feature request
  • I have visited the readme and doc
  • I have searched through the issue tracker and pr tracker
  • I have mentioned version numbers, operating system and environment, where applicable:
  import ding, torch, sys
  print(ding.__version__, torch.__version__, sys.version, sys.platform)
v0.5.2 2.5.1+cu124 3.9.21 (main, Dec 11 2024, 16:24:11) 
[GCC 11.2.0] linux

在编写自定义环境时,参考ding/envs/env/tests/test_env_implementation_check.py文件对环境进行测试,报错:

  File "~/envs/lib/python3.9/site-packages/ding/envs/env/env_implementation_check.py", line 36, in check_array_space
    assert (space.low <= ndarray).all() and (ndarray <= space.high).all(
AttributeError: 'MultiDiscrete' object has no attribute 'low'

动作空间是离散连续混合动作,定义如下:

self.action_space = spaces.Tuple((
            spaces.MultiDiscrete(np.array([self.ch_num + 1] * self.user_num)),
            spaces.Box(low=0, high=1, shape=(1, self.user_num),dtype='float32')))

MultiDiscrete对象默认的下限值low是0,但是它没有low这个属性。
有什么解决思路嘛?

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