Course 4 - Wk 2 - Ass 2 - kernel died - out of memory

Course 4 - Wk 2 - Program Assignment 2 - Transfer Learning
Got error message below:
“The kernel appears to have died. It will restart automatically”.

While running the last part of the fine-tuning assignment:
Epoch 5/10
9/9 [==============================] - 36s 4s/step - loss: 0.6796 - accuracy: 0.7672 - val_loss: 0.3451 - val_accuracy: 0.8462
Epoch 6/10
9/9 [==============================] - 56s 6s/step - loss: 0.3250 - accuracy: 0.8397 - val_loss: 0.2224 - val_accuracy: 0.9231
Epoch 7/10
1/9 [==>…] - ETA: 0s - loss: 0.1379 - accuracy: 0.9688

I only have this notebook running, have tried to re-start the kernel several times. Re-start my computer and run again. Got same problem.

Your help is much appreciated.

Cindy

Perhaps your code has an infinite loop. To guard against that, the kernel has a time-out that detects when your code is stuck.

Thanks for input TMosh.
When I reduced the (initial_epochs = 5) to 3
and (fine_tune_epochs = 5) to 2
The program runs well.

It seems that it runs out of memory with more epochs?
I did not add any additional loops to the code

There is an error in your code. It’s eating memory on every iteration.

Perhaps you deleted something from one of the code loops that you shouldn’t have.

Thank you so much for your help, Tmosh.

Found the error. I forgot to re-freeze the layers.

Working now. :slight_smile: