I have some trained models that I could import and compare, but then the same code gave:

"WARNING tensorflow:From 'where its saved' colocate with (from tensorflow.python.framework.ops)
  is deprecated and will be removed in a future version.
Instructions for updating:
  Colocations handled automatically by placer."

As well as 2 other deprecation warnings.

The code that I am using to import the models is:

"model_1 = load_model("filepath\\filename.h5")"

Restating my computer fixed the issue, but I'm curious as to why this happened, if anyone can explain.


1 Answer 1


I am afraid if you had saved the model in your drive rather google collab directory as it will lost after run-time session interrupt.

model_new = load_model('BestModelWeights.hdf5') # will load model , if BestModelWeights file exist in collab directory --which i feel lost in your case that could be the reason you are getting "where it saved" error.

I would advise use google drive to save weights and directly load weight file when you need.For this you need to follow two steps

  1. Mount google drive and authenticate collab.

    from google.colab import drive drive.mount('/content/drive')

  2. Load model

    model_new = load_model('/content/drive/My Drive/BestModelWeights.hdf5')

and you can play with your new loaded Model.

hope it helps. JSH


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.