Course 4 Week 2 Alpaca model / Error of Data Augmentation

H​ello!

I​ have been struggling how to solve the following error, which I assume I have some issue in the part of “apply data augmentation to the inputs”.
Is it better not to use “data_augmenter()” which is defined previously? or
“inputs” as input data for data augmentation is wrong?
It is appreciated if someone give me advice.

Osamu

---------------------------------------------------------------------------TypeError Traceback (most recent call last)
in ----> 1 model2 = alpaca_model(IMG_SIZE, data_augmentation)

in alpaca_model(image_shape, data_augmentation) 27
28 # apply data augmentation to the inputs—> 29 x = data_augmenter(inputs) 30
31 # data preprocessing using the same weights the model was trained on

TypeError: data_augmenter() takes 0 positional arguments but 1 was given

1 Like

You should not reference the global value that is passed to the parameter data_augmentation: you should just use the parameter value itself. That is a function reference, so you can treat it as such.

@paulinpaloalto
Thank you very much for the advice. Now I can define and it works!

Osamu

1 Like