-
Notifications
You must be signed in to change notification settings - Fork 0
/
colab配置.txt
33 lines (26 loc) · 1.02 KB
/
colab配置.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
from google.colab import drive
drive.mount('/content/drive')
import os
os.chdir('drive/My Drive/time_series/')
!ls
!git clone ……
import os
os.chdir('Generative-Adversarial-Nets-pytorch/')
! ls
! bash weights/download_weights.sh
!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}
!mkdir -p drive
!google-drive-ocamlfuse drive
import os
os.chdir("drive/Colab Notebooks/SegDecNet-master")