paz icon indicating copy to clipboard operation
paz copied to clipboard

Bug in spatial_transformer_network's code

Open AyushSharma2000 opened this issue 2 years ago • 2 comments

Screenshot 2021-08-05 at 11 01 42 PM Screenshot 2021-08-05 at 11 08 40 PM

Environment:

Google Colaboratory. Tensorflow version 2.5.0 Keras version 2.4.x

Tried running the train.py file in examples/Spatial_Transformer_Networks/ and received an error on passing the MNIST dataset present in the STN repository. No changes were made to the code other than changing the file path.

The second screenshot shows the remaining portion of the last line of error present in the first screenshot.

AyushSharma2000 avatar Aug 05 '21 17:08 AyushSharma2000

i met the same bug, can anyone helpful offer a solution?

zjhJOJO avatar Aug 13 '22 05:08 zjhJOJO

change the compute_output_shape function in layer.py file to this solved my problem. def compute_output_shape(self, input_shapes): height, width = self.output_size num_channels = input_shapes[0][-1] return tf.constant([1, height, width, num_channels])

Ataei67 avatar Apr 17 '24 22:04 Ataei67