"TypeError: can't pickle weakref objects" when pickling a deep learning model
can't pickle weakref comes because Deep Learning models are too large and pickle only used for storing small models
Use this : HDF5 used for storing large data
from keras.models import load_modelmodel.save('my_model.h5') # creates a HDF5 file 'my_model.h5'
returns a compiled model
identical to the previous one
model1 = load_model('my_model.h5')y_pred = model1.predict(x_test)