I'm using tensor flow in google colab and I want to save my model on google drive for future use , could anyone guide me on how to do this?
I'm using tensor flow in google colab and I want to save my model on google drive for future use , could anyone guide me on how to do this?
First connect to google drive:
from google.colab import drive
drive.mount('/gdrive')
Next save your model on colab
model.save('modelname')
Saved model will now appear in the 'content' folder. Now create the same folder along with the sub folders in the 'gdrive' folder of colab. You can copy the relevant files to these folders using shutil.
import shutil
shutil.copy('source','destination')
You can use 'copy path' option , to get the exact address of the files. Finally to load your model , you have to connect to drive and load the model.
model = tf.keras.models.load_model('modeladdress')