So for the last couple of weeks I have been trying to retrain different models to try and improve my Keras know-how and also to be able to use my own models in other applications (such as object recognition live on the webcam), omg yes!
Of course along the way I had different struggles with overfitting and what not, but mostly when using larger models my session would crash. Over and over. I thought it was exhausting the CPU and not using the GPU, but after further investigation I came upon others on the world wide web, who faced a similar issue.
My most pressing error would occur when loading in a model, using keras’
model.load() – and it seems it is due to a memory leak. So simply running
keras.backend.clear_session() cleared up the memory and made the notebook run smoothly again. Check out the solution in this git thread.
Thanks again internet!