baselines
baselines copied to clipboard
ShmemVecEnv does not support float64
The _NP_TO_CT
map does not contain an entry for float64.
_NP_TO_CT = {np.float32: ctypes.c_float,
np.int32: ctypes.c_int32,
np.int8: ctypes.c_int8,
np.uint8: ctypes.c_char,
np.bool: ctypes.c_bool}
good point, thanks! Will fix shortly (or you can submit a PR :) - but in that case please add a test)
This is still a problem. Are there any workarounds while we wait for the PR?
Changing the dict to the following worked for my application:
_NP_TO_CT = {np.float64: ctypes.c_double,
np.float32: ctypes.c_float,
np.int32: ctypes.c_int32,
np.int8: ctypes.c_int8,
np.uint8: ctypes.c_char,
np.bool: ctypes.c_bool}
Seems that on master branch this is still not yet fixed. What is the reason behind this?
also curious as to the holdup. many of us can use SubprocVecEnv
as a workaround but its much slower
has there been any fix for this?
when my spaces are with float64 I get:
File "/home/baselines/baselines/common/vec_env/shmem_vec_env.py", line 50, in <dictcomp>
{k: ctx.Array(_NP_TO_CT[self.obs_dtypes[k].type], int(np.prod(self.obs_shapes[k]))) for k in self.obs_keys}
KeyError: <class 'numpy.float64'>
Can't you cast your observations to float32?
On Wed, Jul 15, 2020, 1:29 AM Alireza Ranjbar [email protected] wrote:
has there been any fix for this?
when my spaces are with float64 I get:
File "/home/baselines/baselines/common/vec_env/shmem_vec_env.py", line 50, in
{k: ctx.Array(_NP_TO_CT[self.obs_dtypes[k].type], int(np.prod(self.obs_shapes[k]))) for k in self.obs_keys} KeyError: <class 'numpy.float64'> — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/openai/baselines/issues/749#issuecomment-658626493, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAS63NIJ24FBZ276TS5YB73R3VSH7ANCNFSM4GIEKRLA .