安装anaconda后,Pytorch不会导入

技术标签: 苹果系统  python-3.x.  iPython.  蟒蛇  Pytorch.

我刚刚在安装anaconda后安装了pytorch,当我使用anaconda python运行ipython时,它将找不到pytorch。 enter image description here

enter image description here

但是,我可以验证pytorch是否位于我的anaconda文件夹的pkgs目录中。这是怎么回事?

看答案

虽然框架名称是pytorch,但必须使用它使用它 火炬 命名空间如此 import torch。如果你看官方文件 这里,您将看到任何Pytorch相关模块导入,如nn或autograd完成 火炬 命名空间。我承认有点令人困惑,但我想这是为了灌输对旧火炬7用户的熟悉感。此外,有一个非常好的介绍教程,您可能会用来熟悉Pytorch的Ins和Outs更好地熟悉自己 这里。希望这可以帮助!


智能推荐

anaconda 安装tensorflow和pytorch

anaconda 安装tensorflow和pytorch 下载anaconda 开始安装tensorflow 安装pytorch 下载anaconda 清华镜像源(https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/),下载最新的就可以,无脑安装,有个地方需注意,这个地方都勾上。 开始安装tensorflow 打开anaconda prom...

在Anaconda下安装Pytorch

在Anaconda下安装Pytorch 之前在Anaconda中新建了个环境安装tensorflow,但是后来忘了怎么装的了。。现在装Pytroch,又重新来了一次,主要参考这个:https://blog.csdn.net/qq_33183517/article/details/90484840 讲得特别明白 但是过程中中间出了很多小问题,参考了 https://blog.csdn.net/qq_...

linux安装anaconda 配置pytorch

安装anaconda参考https://blog.csdn.net/lwgkzl/article/details/89329383 运行命令 wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/Anaconda3-5.2.0-Linux-x86_64.sh 注意:anaconda的版本和python对应关系,参照https://bl...

anaconda+pycharm+pytorch安装

记录一下第一次搞机器学习环境,万事开头真是难啊啊。。。 首先记一下anaconda和pycharm是什么?被好多名字好多功能搞得晕头转向。 anaconda:管理python环境的工具 pycharm:python的IDE anaconda中也集成了一些IDE,pycharm中也可以设置虚拟环境,但很多人都这样搭配使用,可能他们的长处更明显吧,目前只是这样简单理解。 anaconda+pychar...

「机器学习_5」逻辑回归(Logistic Regression )

学习逻辑回归需要清楚的几件事:假设函数怎么用(怎么预测),决策边界怎么用(一般取0.5),损失函数如果计算(因为要取最小),优化方法(重新计算各个权重) 建议:我阅读的英文参考资料的相关内容除了公式我并没有往上发布。但是我会放到我的下载资料中,建议,想彻底理解这几个内容的,如果不想直接从公式推导入手,可以考虑看下具体的例子,就会明白其中的含义。   前言  本文主要介绍逻辑回归的基础知识...

猜你喜欢

工业4.0知识图谱

编者按         本篇文章来自于17th Extended Semantic Web Conference (ESWC2020) 会议。该文章提出了基于语义标注网络的结构化数据集,包含工业4.0标准、范式和框架,并给出了知识图谱在工业4.0应用的现有案例。   本文作者北京大学周雨奇,将对原文进行概要阐述。   文末提供获...

缓冲区溢出实例(二)–Linux

原理:crossfire 1.9.0 版本接受入站 socket 连接时存在缓冲区溢出漏洞。 工具: 调试工具:edb; ###python在漏洞溢出方面的渗透测试和漏洞攻击中,具有很大的优势 实验对象:crossfire【多人在线RPG游戏】 运行平台:Kali i386 虚拟机【32位,计算机CPU位数是指地址总线位数,64位系统的寻址空间为2^64,寻址过大,难以处理,为了简化操作,所以选用...

如何使用物联网设备来确保儿童安全? | Linux 中国

物联网设备提供的好处很多。举例来说,父母可以远程监控自己的孩子,而又不会显得太霸道。因此,儿童在拥有安全环境的同时也会有空间和自由让自己变得独立。 -- Andrew Carroll IoT (物联网)设备正在迅速改变我们的生活。这些设备无处不在,从我们的家庭到其它行业。根据一些预测数据,到 2020 年,将会有 100 亿个 IoT 设备。到 2025 年,该数量将增长到 220 亿。目前,物联...

windows 组策略

通过 Windows 组策略,实现登录启动指定脚本。 1、快捷键 win+R,输入 gpedit.msc,点击 ok 2、在 Local Group Policy Editor 对话框中选择:Local Computer Policy --> User Configuration --> Windows Settings – > Scripts,然后点击右侧 Logo...

初学3ds Max,做了个雪人,大家来评评哪个更好看

左边的是我做的,右边的是女朋友做的,大家评评看,哪个好看啊^^ *********************************************** 哈哈,最后评论的结果似乎我就输了一点点啊。。。。。。。感谢各位捧场^^...

问答精选

insertMany drop down mongodb service

I have API, where I get datas. I use mongoose to save it into my local MongoDB. Each time when I save, I create dynamically new model and use insertMany on it: But... later, when all almost complete, ...

How to use Task.WhenAll to wait for third party Async method call

I have been trying to figure this out for a few hours and haven't been able to understand why this isn't working. I have a TPL Dataflow batch block that accepts a batch of files that I want to upload....

Python Pandas KeyError when trying to save a timestamp to MySQL

I'm trying to save a data frame to a mysql database. But it seems that it doesn't work because of the timestamp (format?). When I run this script, the following Error occurs ..... Can't figure it out ...

Auto renumbering sections with Notepad++ automated scripts

I am a modder with very little scripting experience. I need a way to renumber the following Sections of a file: etc. The file looks like this: and has to be continued like this: and so on. So simply s...

Write log-file when testing with NUnit

I have a test-assembly (MyTestProject) where I want to write some logging using log4net. Thus I created a config-file with the same name as the assembly where I set up the logging as suggested here: W...

相关问题

相关文章

热门文章

推荐文章

相关标签

推荐问答