Question: NameError Traceback ( most recent call last ) Cell In [ 1 0 ] , line 7 4 model.add ( layers . Flatten ( input

NameError Traceback (most recent call last)
Cell In[10], line 7
4 model.add(layers.Flatten(input_shape=self.input_shape))
6 for i in range(hp.Int('num_layers', min_value=1, max_value=3)):
---->7 model.add(layers.Dense(units=hp.Int('units_'+ str(i), min_value=32, max_value=512, step=32), activation='relu'))
9 # Dropout rate (except the last layer)
10 if i <(hp.Int('num_layers')-1):
NameError: name 'model' is not defined
It's an error, how to remove this error?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!