While executing the alpaca_model function in the week 2 2nd assignment of the CNN course, I am getting the following error. I am not understanding why is this error. Kindly help.
TypeError: unsupported operand type(s) for /=: ‘Sequential’ and ‘float’
in alpaca_model(image_shape, data_augmentation)
30
31 # data preprocessing using the same weights the model was trained on
—> 32 x = preprocess_input(x)
33
34 # set training to False to avoid keeping track of statistics in the batch norm layer
/opt/conda/lib/python3.7/site-packages/tensorflow/python/keras/applications/imagenet_utils.py in _preprocess_symbolic_input(x, data_format, mode)
261 “”"
262 if mode == ‘tf’:
→ 263 x /= 127.5
264 x -= 1.
265 return x
TypeError: unsupported operand type(s) for /=: ‘Sequential’ and ‘float’
One possible error would be not passing an input to the data augmenter, so that the output value of that function is a sequential object and not a tensor. That would probably cause the error message you are showing.