pytorch部署jupyter

软件发布|下载排行|最新软件

当前位置:首页IT学院IT技术

pytorch部署jupyter

henu-于笨笨   2022-06-03 我要评论

pytorch部署到jupyter中

在这里插入图片描述

在安装Aconda的同时,会将jupyter notebook一起安装,不过这里的jupyter notebook是base中的jupyter notebook二不是pytorch中的jupyter notebook,因此并不能在此jupyter notebook运行torch包。
base中的jupyter:

在这里插入图片描述

两种解决方案

一、base中重新安装pytorch
二、pytorch中安装jupyter notebook
这里选择第二种方法
首先

conda activate pytorch

进入到pytorch环境中去

在这里插入图片描述

在pytorch环境中看包

conda list

在这里插入图片描述

没有我们需要的包,因此输入命令,进行下载jupyter

conda install nb_conda_kernels

进行下载
下载完成后输入命令:

jupyter notebook

打开jupyter notebook
注:我再输入的时候出现了一些无法定位的提示,但是我的电脑没有影响使用jupyter,还是可以使用jupyter并且可以import torch

在这里插入图片描述

点击确定,就可以来到jupyter notebook的页面了

在这里插入图片描述

让我们来验证一下

在这里插入图片描述

Copyright 2022 版权所有 软件发布 访问手机版

声明:所有软件和文章来自软件开发商或者作者 如有异议 请与本站联系 联系我们