Search code examples
python-3.xkerasdrivegoogle-colaboratory

Google Colab - Where is the output saved?


I am training a machine learning model on google's colab. I am using keras with tensorflow backend (python 3.6). I am saving my model using the model.save() function provided by keras. When I call model.save('model_name)` where is the file saved? I cannot find it in my drive anywhere.


Solution

  • First, mount your drive:

    !mkdir -p drive
    !google-drive-ocamlfuse drive
    

    Now, append your path:

    import sys
    sys.path.append('drive/Project')
    

    You should be able to see your files on your local and web-based drive using:

    model.save('drive/Project/myModel.h5')