Skip to content

Commit

Permalink
fix level5 classifier layers having float type shape
Browse files Browse the repository at this point in the history
  • Loading branch information
pesekon2 committed Aug 27, 2023
1 parent 5ccbe97 commit a434628
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/architectures.py
Original file line number Diff line number Diff line change
Expand Up @@ -1196,10 +1196,15 @@ def instantiate_layers(self):
# 1. if you wish to understand the nr of filters, see the corresponding
# comment in VGG
# 2. the kernel corresponds to the entire feature map
level5_tensor_shape = self.tensor_shape[0] / (2 ** 5)
if level5_tensor_shape % 1 == 0:
level5_tensor_shape = int(level5_tensor_shape)
else:
raise ModelConfigError('Last layer dimensions do not seem to be'
'integers.')
self.level5_classifier_layers.append(
ConvBlock((self.nr_filters * (2 ** 4), ),
((self.tensor_shape[0] / (2 ** 5),
self.tensor_shape[1] / (2 ** 5)), ),
((level5_tensor_shape, level5_tensor_shape, ),
(self.activation, ), (self.padding, ),
self.dilation_rate,
dropout_rate=self.dropout_rate_hidden,
Expand Down

0 comments on commit a434628

Please sign in to comment.