赞
踩
①获取d21安装包:https://blog.csdn.net/scar2016/article/details/115053959
②安装指导**(重点)**:https://blog.csdn.net/sheri_/article/details/121826578
①下载安装包,将安装包导入到google drive中(建立一个package文件夹存储安装包)
②该步可能出现warning,不慌,继续跑
import os, sys
# 挂载google drive
from google.colab import drive
drive.mount('/content/gdrive')
nb_path = '/content/notebooks'
os.symlink('/content/gdrive/My Drive/pytorch_notebook', nb_path)
# 添加sys path
sys.path.insert(0, nb_path) # or append(nb_path)
!pip install --target=$nb_path d2l
OK!!!
③每次使用时
import sys
from google.colab import drive
drive.mount('/content/gdrive')
sys.path.insert(0,"/content/gdrive/My Drive/Colab Notebooks/python_package/")
from d2l import torch as d2l
from matplotlib_inline import backend_inline
畅通无阻!!!
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。