avoid DeprecationWarning
This commit is contained in:
parent
e3329b35e5
commit
b408067d9a
@ -36,9 +36,9 @@ class MemoryMaze:
|
|||||||
return {
|
return {
|
||||||
**spaces,
|
**spaces,
|
||||||
"reward": gym.spaces.Box(-np.inf, np.inf, (), dtype=np.float32),
|
"reward": gym.spaces.Box(-np.inf, np.inf, (), dtype=np.float32),
|
||||||
"is_first": gym.spaces.Box(0, 1, (), dtype=np.bool),
|
"is_first": gym.spaces.Box(0, 1, (), dtype=bool),
|
||||||
"is_last": gym.spaces.Box(0, 1, (), dtype=np.bool),
|
"is_last": gym.spaces.Box(0, 1, (), dtype=bool),
|
||||||
"is_terminal": gym.spaces.Box(0, 1, (), dtype=np.bool),
|
"is_terminal": gym.spaces.Box(0, 1, (), dtype=bool),
|
||||||
}
|
}
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
@ -77,8 +77,8 @@ class CollectDataset:
|
|||||||
dtype = {16: np.int16, 32: np.int32, 64: np.int64}[self._precision]
|
dtype = {16: np.int16, 32: np.int32, 64: np.int64}[self._precision]
|
||||||
elif np.issubdtype(value.dtype, np.uint8):
|
elif np.issubdtype(value.dtype, np.uint8):
|
||||||
dtype = np.uint8
|
dtype = np.uint8
|
||||||
elif np.issubdtype(value.dtype, np.bool):
|
elif np.issubdtype(value.dtype, bool):
|
||||||
dtype = np.bool
|
dtype = bool
|
||||||
else:
|
else:
|
||||||
raise NotImplementedError(value.dtype)
|
raise NotImplementedError(value.dtype)
|
||||||
return value.astype(dtype)
|
return value.astype(dtype)
|
||||||
|
@ -10,3 +10,4 @@ einops==0.3.0
|
|||||||
protobuf==3.20.0
|
protobuf==3.20.0
|
||||||
gym==0.19.0
|
gym==0.19.0
|
||||||
dm_control==1.0.9
|
dm_control==1.0.9
|
||||||
|
scipy==scipy==1.9.0
|
2
tools.py
2
tools.py
@ -127,7 +127,7 @@ def simulate(agent, envs, steps=0, episodes=0, state=None):
|
|||||||
# Initialize or unpack simulation state.
|
# Initialize or unpack simulation state.
|
||||||
if state is None:
|
if state is None:
|
||||||
step, episode = 0, 0
|
step, episode = 0, 0
|
||||||
done = np.ones(len(envs), np.bool)
|
done = np.ones(len(envs), bool)
|
||||||
length = np.zeros(len(envs), np.int32)
|
length = np.zeros(len(envs), np.int32)
|
||||||
obs = [None] * len(envs)
|
obs = [None] * len(envs)
|
||||||
agent_state = None
|
agent_state = None
|
||||||
|
Loading…
x
Reference in New Issue
Block a user