连接Google Drive from google.colab import drive drive.mount('/content/drive') 直接将本地写好的notebook程序上传到Google Drive,然后打开运行即可 ! ls /content/drive/MyDrive/ ! python /content/drive/MyDrive/filename.py 保存./data目录下载的数据集 ! ls /content/data ! mkdir /content/drive/MyDrive/DL_Dataset ! cp -r /content/data/* /content/drive/MyDrive/DL_Dataset/ 保存训练好的模型文件 ! cp -r /content/xxx.pth /content/drive/MyDrive/DL_Model/