我正在尝试使用以下代码在 Colab 上安装我的驱动器:
from google.colab import drive
drive._mount('/content/drive')
我收到以下错误:
298 # Terminate the DriveFS binary before killing bash.
ValueError: mount failed: invalid oauth code
尝试删除cookie,重新启动会话,但似乎没有任何效果。我使用了几个不同的谷歌帐户,只有一个订阅了 Colab Pro.. 但这直到今天才成为问题。
Thanks.
目前唯一有效的解决方案是来自两个月前这个类似的问题: https://stackoverflow.com/questions/69819761/i-cant-mount-my-another-drive-in-google-colab/70797774#70797774
!apt-get install -y -qq software-properties-common python-software-properties module-init-tools
!add-apt-repository -y ppa:alessandro-strada/ppa 2>&1 > /dev/null
!apt-get update -qq 2>&1 > /dev/null
!apt-get -y install -qq google-drive-ocamlfuse fuse
from google.colab import auth
auth.authenticate_user()
from oauth2client.client import GoogleCredentials
creds = GoogleCredentials.get_application_default()
import getpass
!google-drive-ocamlfuse -headless -id={creds.client_id} -secret={creds.client_secret} < /dev/null 2>&1 | grep URL
vcode = getpass.getpass()
!echo {vcode} | google-drive-ocamlfuse -headless -id={creds.client_id} -secret={creds.client_secret}
%cd /content
!mkdir drive
%cd drive
!mkdir MyDrive
%cd ..
%cd ..
!google-drive-ocamlfuse /content/drive/MyDrive
希望能用正常的方式drive.mount
很快就会修好!
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)