Introduction to TensorFlow for Artificial Intelligence, Machine Learning, and Deep Learning → housing price exercice …
error : Failed test case: model has incorrect type.
Expected:
<class ‘keras.engine.training.Model’>,
but got:
<class ‘NoneType’>.
still having the same problem: the full error is :“Failed test case: model has incorrect type.
Expected:
<class ‘keras.engine.training.Model’>,
but got:
<class ‘NoneType’>.”
You are importing keras too, so, using keras with and without tf. would work.
Is your pre-defined code looks like this:
First Cell Code:
import tensorflow as tf
import numpy as np
Second Cell Code:
# GRADED FUNCTION: house_model
def house_model():
### START CODE HERE
# Define input and output tensors with the values for houses with 1 up to 6 bedrooms
# Hint: Remember to explictly set the dtype as float
xs = None
ys = None
# Define your model (should be a model with 1 dense layer and 1 unit)
model = None
# Compile your model
# Set the optimizer to Stochastic Gradient Descent
# and use Mean Squared Error as the loss function
model.compile(optimizer=None, loss=None)
# Train your model for 1000 epochs by feeding the i/o tensors
model.fit(None, None, epochs=None)
### END CODE HERE
return model
sorry it is still not working i tried usiing TF , not using TF … i tried again using the code from scracth … but the i still not getting approval … this it the very basic exercice and l already approved other more complex scenarios… i think there is issue with the validation of the tool… this is not help me if i can not share the code with you. i already did the scenario under jupiter notebook and it is running ok…
Can you please post the error you are getting with screenshot image. There is another post related to this assignment which has solutions for this similar error. Kindly refer using search engine or post the screenshot here.
If your model is not defined with correct code and/or has not replaced all the None inside #START AND END CODE HERE, you will encounter such error.
Your error is related to the below model code
Define your model (should be a model with 1 dense layer and 1 unit)
model = None(this code has been written incorrectly.
Kindly go through the link in the previous comment where it gives hints to correct the code.
If still unable to correct, send me your codes for this grader cell via personal DM. Do not post codes here. Click on my name and then message.
you have used
model = tf.keras.Sequential([tf.keras.layers.Dense(units=1, input_shape=[1])])
this code is incorrect. your code is not defining the model for the keras define dense layer. and the image below should help you differentiate between what part of your code is missing in your code.