0

I have created an object which is compounded by a lot of methods. This object takes a long time to build. My question is if exists a way to save the object in my drive in order to load it in another notebook?

I'm working in google colab (python)

Thanks a lot!

  • 1
    try joblib.pickle – Till Jul 28 '22 at 14:46
  • 1
    The built-in `pickle` module allows you to save any Python object to a file – Filip Müller Jul 28 '22 at 14:47
  • Does this answer your question? [When I use Google Colaboratory, how to save image, weights in my Google Drive?](https://stackoverflow.com/questions/49031798/when-i-use-google-colaboratory-how-to-save-image-weights-in-my-google-drive) – hellohawaii Jul 29 '22 at 02:04

1 Answers1

0

Mount your google drive:

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

then use joblib:

import joblib

joblib.dump(object, 'drive/path/filename')

then

object = joblib.load('drive/path/filename')
1extralime
  • 606
  • 3
  • 6