Your model could not be loaded error

Hello, I am running the model on my own PC so I can use GPUs to train faster. I am using TensorFlow2.10 for that purpose.

I changed the batch size to 256 so I wouldnt get “resourcesexhaustion” error. I also used 3 Conv and Deconv layers with 48, 96, 192 filters

I have trained model for 30 epochs down to a MSE of 214 and saved it using "vae.save.

I also created a custom function to check the average SSIM at the end of my notebook and the model achieves 0.58 pn the validation set.

But now when I upload the model it gives me this error:
“Your model could not be loaded. Make sure it is a valid keras file, if this is the case please let us know.”

I read elsewhere that KDLoss should be KDLayer, which it was by default in the collab notebook I downloaded.

Please help.


I think it was due to different versions of tensorflow and keras. I ended up waiting for the GPU to be available in Collab and resubmitted the model. It worked.

2 Likes