Closed wmmc88 closed 4 years ago
Good catch! Seems like bit of a brain-derp in the code right there. A PR to fix this would be welcome! :)
Good catch! Seems like bit of a brain-derp in the code right there. A PR to fix this would be welcome! :)
Will do!
Hey guys, I know this is not the right place to ask for help on personal issues but I could not find anything else on the internet.
So I am getting the error TypeError: ufunc 'isnan' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''
My action and observation spaces are both Dicts
self.observation_space = spaces.Dict({
"theta": spaces.Box(0, 2*math.pi, shape = (M,M)),
"gk_real": spaces.Box(-np.inf, np.inf, shape = (k, M)),
"rk_real": spaces.Box(-np.inf, np.inf, shape = (k, 1)),
"v_real": spaces.Box(-np.inf, np.inf, shape = (M,)),
"gk_imag": spaces.Box(-np.inf, np.inf, shape = (k, M)),
"rk_imag": spaces.Box(-np.inf, np.inf, shape = (k, 1)),
"v_imag": spaces.Box(-np.inf, np.inf, shape = (M,)),
})
# print(self.observation_space.sample())
self.action_space = spaces.Dict({
"theta": spaces.Box(0, 2*math.pi, shape = (M,M)),
"pk": spaces.Box(-np.inf, np.inf, shape = (k,)),
})
I don't understand the issue here. Thanks in advance.
Hi @Sukhamjot-Singh, we need way more information about your problem to be able to help you. Fortunately, we have a "custom env" template to help you describe your issue. Make sure to provide a code as minimal as possible, for example, remove most of your space dict keys if their removal doesn't solve the issue.
Hi @Sukhamjot-Singh, we need way more information about your problem to be able to help you. Fortunately, we have a "custom env" template to help you describe your issue. Make sure to provide a code as minimal as possible, for example, remove most of your space dict keys if their removal doesn't solve the issue.
Okay I understand. I will post my problem there. Thank you.
Describe the bug An environment with a Dict Action Space, but a non-Dict non-Tuple Observation Space, will fail the
_check_nan(env)
check because ofTypeError: ufunc 'isnan' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''
.I believe the fix to this is just adding a check that the action space is non-tuple, non-dict here.
Full Error Output:
System Info Describe the characteristic of your environment: