2

我最近一直在使用 colab,直到现在我使用 google-drive-ocamlfuse 将我的项目链接到我的驱动器,但它无法加载包。

!apt-get update -qq 2>&1 > /dev/null
!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
!add-apt-repository ppa:alessandro-strada/google-drive-ocamlfuse-beta
!apt-get update -qq 2>&1 > /dev/null
!apt-get -y install -qq google-drive-ocamlfuse fuse

在这里得到了参考表格 https://medium.com/@burakteke/tutorial-on-using-google-colab-for-kaggle-competition-620393c22821

直到昨天它像魅力一样工作,但今天它突然停止工作。

4

2 回答 2

5

根据https://github.com/astrada/google-drive-ocamlfuse/issues/493#issuecomment-422380636 ,这应该可以正常工作

https://launchpad.net/~alessandro-strada/+archive/ubuntu/ppa/+packages更改amd64, arm64, armhf,之间的构建i386

!apt-get install -y -qq software-properties-common python-software-properties module-init-tools
!wget https://launchpad.net/~alessandro-strada/+archive/ubuntu/google-drive-ocamlfuse-beta/+build/15331130/+files/google-drive-ocamlfuse_0.7.0-0ubuntu1_amd64.deb
!dpkg -i google-drive-ocamlfuse_0.7.0-0ubuntu1_amd64.deb
!apt-get install -f
!apt-get -y install -qq 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}
于 2018-09-18T13:00:21.157 回答
0

一个更简单的解决方法是使用内置的 Drive FUSE 客户端:

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

更多详情: https ://colab.research.google.com/notebooks/io.ipynb#scrollTo=u22w3BFiOveA

于 2018-10-07T19:18:50.867 回答