C2W2 create_model

im a new pythoner, please do me a favor below :slight_smile:
# Get the augmentation layers (or model) from your earlier function
augmentation_layers = create_augmentation_model()

# Don't forget to add the augmentation layers! These usually go right after the Input!
model = tf.keras.models.Sequential([ 
	augmentation_layers,,
            create_model
]) 

and i got a error below
ValueError: Only instances of keras.Layer can be added to a Sequential model. Received: <function create_model at 0x7f951c7af920> (of type <class ā€˜functionā€™>)

posting codes is against community guidelines

I donā€™t recognize this code as being part of DLS C4 (ConvNets). Iā€™m guessing it must be from one of the TF specializations. Please edit the title using the little ā€œedit pencilā€ to move it to the correct course category.

So I donā€™t know this exercise, but just looking at what you show, note that the first live code in create_model is just a list of instantiated layers, but you havenā€™t assigned that to anything. So what does that code even mean? Donā€™t you need to wrap that list of functions with tf.keras.models.Sequential to create a function object instead of a list which there is no way to reference?

If youā€™re new to python, youā€™ve jumped into the deep end of the swimming pool here. Weā€™re doing Object Oriented Programming at a pretty high level here: you have to understand the definitions of all the TF/Keras classes that you are using here, even over and above knowing the python syntax. Have you programmed in any other languages that support OOP (Java, C++)? If not, it might be a good idea to take a python course first, unless you have a very high tolerance for frustration. :nerd_face:

1 Like

this is from tensorflow developer course, @derek please be careful while posting topic. for better understanding refer faq section on how to post. Please take a screenshot of the error and post that when you encounter any issue, or in case you have a different output than expected you can share that too but without sharing Any grade cell codes

2 Likes

for code line where you are suppose to add augmentation layer, you have added create model which is incorrect here.

Actually you seem to have added more code line, please get a fresh copy and redo the assignment.

Also please make sure to write only codes as per instructed, do not add any extra codes especially between assigned markers ###START AND END CODE HERE###

1 Like

so grateful for your kindly and helpful suggestions.
i will retry it.
thank again. :slight_smile:

2 Likes

i passed C2W2 , coz your wonderful reminder.

1 Like

I am truly lost with this one, I have been working on it for almost a week now and cannot get the accuracy of the model above 74%. I have no idea what Iā€™m doing wrong, but I feel that the order of steps in the weekly assignment is different than the steps listed in the notebooks.

Hi @Westin_Thatcher

I am here to guide you, and I can understand your condition at addressing your concern, but can you create a fresh new topic with your concerned explanation on getting 74% model accuracy? Perhaps did you miss any of the instructions from the assignment, lets guide you back to the ship, but please first create a fresh topic, you can tag me there with @ mention my name.

Then without sharing codes, let me know what parameters did you use, like what optimization methods, loss? or if you created a model with how many layers.

You can also post a screenshot of your model training output, just make sure not to post any grade cell codes as it is against community guidelines.

Regards
DP

Regards