Skip to content

Commit

Permalink
Fix shape mismatch when train only with CPU
Browse files Browse the repository at this point in the history
  • Loading branch information
Innov-Plus committed Sep 28, 2018
1 parent cfb31f6 commit e6bcefb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/datasources/unityeyes.py
Expand Up @@ -296,6 +296,6 @@ def noisy_value_from_type(augmentation_type):
for landmark in entry['landmarks']
]).astype(np.float32)
if self.data_format == 'NHWC':
np.transpose(entry['heatmaps'], (1, 2, 0))
entry['heatmaps'] = np.transpose(entry['heatmaps'], (1, 2, 0))

return entry
5 changes: 4 additions & 1 deletion src/models/elg.py
Expand Up @@ -75,7 +75,10 @@ def build_model(self, data_sources: Dict[str, BaseDataSource], mode: str):
with tf.variable_scope('hourglass'):
# TODO: Find better way to specify no. landmarks
if y1 is not None:
self._hg_num_landmarks = y1.shape.as_list()[1]
if self._data_format == 'NCHW':
self._hg_num_landmarks = y1.shape.as_list()[1]
if self._data_format == 'NHWC':
self._hg_num_landmarks = y1.shape.as_list()[3]
else:
self._hg_num_landmarks = 18
assert self._hg_num_landmarks == 18
Expand Down

0 comments on commit e6bcefb

Please sign in to comment.