Transfer Learning Implementation using ResNet - 50 Base

There is some error in this code. Could you fix it. https://colab.research.google.com/drive/1EqG7d__PIow4yt_mlIpweJPV-SyUbwQ0?usp=sharing

hey @amanbh_123,
you need to update the way you create those model.
like this

input = Input(shape=image_shape_here))
base_model = Resent50
output = base_model(input)
… then futher feedforward network.

In this way it will work.

Still there is some problem. You can edit in this link : https://colab.research.google.com/drive/1EqG7d__PIow4yt_mlIpweJPV-SyUbwQ0?usp=sharing

instead of importing from keras.
load them from tensorflow.keras

and then restart your session once on colab.
and instead of base_model.output , just use output

It will work.

Okk that error is fixed now. Could you tell why it was giving error before and why it is working fine now?

The reason was in way of providing and making the model.
You were providing the model.outputs , which results in something else , not a layer, where you needed to provide a layer.

And as e changed it it worked fine.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.