Course 4 Week 2 Programming exercise 1 ResNet50 FUNCTION

I am getting this error in the Resnet50 function [
‘Conv2D’, (None, 15, 15, 256), 16640, ‘valid’, ‘linear’, ‘RandomUniform’]

does not match the input value:

[‘Conv2D’, (None, 15, 15, 256), 16640, ‘same’, ‘linear’, ‘RandomUniform’]

this is my code: {code removed}

Welcome to the community @Fares_Mohamed_Sayed.
Check the strides of different stages in the network architecture.

Please do not post your code on the Forum. That is not allowed by the course Honor Code.

Sorry, didn’t know that.

No problem.

If you have a question or problem with a programming assignment, you can post the assert stack and any error messages.

If a mentor needs to see your code, we’ll ask you to send it via a private message.

Will do thanks again.

Did you find the solution? It doesn’t have to do with the stride. Notice what is different between the two layers: you have apparently specified “same” padding, but the expected value is “valid”.

I am currently having the same issue, every other layer is fine for me except those sets of layers. As a matter of fact, my convolutional_block and identity block passed all the unit tests. If I go back to change it to ‘same’ in the function definition, it will affect every other layer.

The point is not changing it to “same”. The point is you must have specified “same”, but it wants you to specify “valid”. Of course “valid” is the default padding on a Conv2D layer, so that would be equivalent to not setting the padding parameter as part of the call.

Yes the issue was with strides , Itried the padding solution but i noticed that i missed up with the stride count

I have a problem with the deployment of the trained model for the prediction. Indeed I trained a network to classify land use from satellite images. I saved the model in h5 format, but I miss the deployment technique for prediction. Please help me !

Translate in to french text:

Moi j’ai un souci sur le déploiement du modèle entraîné pour la prédiction. En effet j’ai entraîné un réseau à classifier l’occupation du sol à partir des images satellitaires. J’ai sauvegardé le modèle au format h5, mais la technique de déploiement pour la prédiction me manque. S’il vous plaît, aidez-moi !

Every instance the Keras “Model” class (which is what we have here) has lots of “methods”, including ones you’ve already seen in the notebook (e.g. “fit” and “compile”). Try looking up the “predict” method and I hope that will be what you need for this case. The docpage for that also explains that “predict” is really intended for handling large datasets efficiently and you can also just “call” the model. I think they give you enough information to find out how to use “call” as well.