Skip to content

Commit

Permalink
use_gpu=False error fixed when conv is not used
Browse files Browse the repository at this point in the history
  • Loading branch information
carpedm20 committed Jun 16, 2016
1 parent 95ed9d8 commit 65ed340
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion agents/experience.py
Expand Up @@ -49,7 +49,7 @@ def sample(self):
rewards = self.rewards[indexes]
terminals = self.terminals[indexes]

if self.data_format == 'NHWC':
if self.data_format == 'NHWC' and len(self.prestates.shape) == 4:
return np.transpose(self.prestates, (0, 2, 3, 1)), actions, \
rewards, np.transpose(self.poststates, (0, 2, 3, 1)), terminals
else:
Expand Down
2 changes: 1 addition & 1 deletion agents/history.py
Expand Up @@ -13,7 +13,7 @@ def reset(self):
self.history *= 0

def get(self):
if self.data_format == 'NHWC':
if self.data_format == 'NHWC' and len(self.history.shape) == 3:
return np.transpose(self.history, (1, 2, 0))
else:
return self.history

0 comments on commit 65ed340

Please sign in to comment.