加載云端硬盤
需要在左上角點擊這個文件圖標;
from google.colab import drive
drive.mount("/content/drive") # 掛載云端硬盤import os
path="/content/drive/MyDrive/TextClassificationCustom"
os.chdir(path) # 以路徑path作為當前工作目錄
os.listdir(path)current_working_directory = os.getcwd() # 顯示當前工作目錄
使用GPU
找到這個地方的筆記本設置
,選擇GPU
運行.py文件
到達指定路徑之后,運行如下命令:
!python main.py