Google colab运行py文件

import torch//引入torch包
print(torch.cuda.is_available())//确定gpu是否可用
from google.colab import drive
drive.mount("/content/drive")
import os
path="/content/drive/My Drive/untitled"//进入文件夹
os.chdir(path)
os.listdir(path)
!python demo.py//运行文件
!pwd 1
!ls
%cd /content/sample_data
!ls
posted @ 2021-10-27 16:58  祥瑞哈哈哈  阅读(599)  评论(0)    收藏  举报