jeffheaton / t81_558_deep_learning

T81-558: Keras - Applications of Deep Neural Networks @Washington University in St. Louis
https://sites.wustl.edu/jeffheaton/t81-558/
Other
5.71k stars 3.04k forks source link

Model unable to train (CNN doesn’t work) #126

Closed yibingtan closed 2 years ago

yibingtan commented 2 years ago

Hello, I have followed this website: https://github.com/jeffheaton/t81_558_deep_learning/blob/master/install/tensorflow-install-mac-metal-jul-2021.ipynb on how to install tensorflow on my macbook. However, my code stops when I try to run CNN and LSTM.

My cell will be marked as completed but I will still be at epoch 1 /3. Then the whole code will fail.

This is where I get the code from: https://keras.io/examples/nlp/text_classification_from_scratch/

Screenshot 2021-10-13 at 10 02 54 PM
jeffheaton commented 2 years ago

I cannot really provide support for the code on kerias.io, it is not my creation. The error that you have suggestions you did not copy/paste the like where the model is defined, make sure you include everything. Have a particular look at:

model = tf.keras.Model(inputs, predictions)

As this defines "model" which is causing you your error above.