I am using google-colaboratory GPU to train NN models. My python/pytorch code is stored in google-drive. I am able to mount my drive in colaboratory and train models. But any python code changes in the "my drive" is not updated to google-colaboratory even after rebooting my PC and start all again.
To clear the google-colaboratory cache I tried :
!google-drive-ocamlfuse -cc
But it does not work:
/bin/bash: google-drive-ocamlfuse: command not found
How to clean this cache and avoid waiting hours before my code being taken into account by google-colaboratory ? Thanks in advance
PS : the method I used to mount:
from google.colab import drive
drive.mount('/content/drive/')
google-drive-ocamlfuse
is irrelevant to mounts using google.colab.drive.mount
as described in the PS, so not surprising the -cc invocation is not helping you.
I suspect what's happening is you have .py
files stored in Google Drive, which you're import
ing in your notebook, and you want to see changes to the .py
files reflected in your runtime, but they're not because python's import
system is idempotent (an import
statement is ignored if python thinks it's already loaded a module by that name, even if the underlying file has changed).
You can force a reload using something like https://stackoverflow.com/a/437591/8755609 e.g.:
from importlib import reload # Py3 only; unneeded in py2.
foo = reload(foo)
(obvs replace foo
with your module's name).