【问题标题】:`conda install pytorch` results in 'Illegal instruction' with `import torch``conda install pytorch` 使用`import torch` 导致“非法指令”
【发布时间】:2019-08-19 10:34:42
【问题描述】:

全新安装 anaconda,然后是 conda install pytorch,每当我 import torch 时,我都会得到一个 Illegal instruction(使 python 解释器崩溃):

(base) ~$ python -c 'import torch'
Illegal instruction
(base) 132 ~$

【问题讨论】:

    标签: installation pytorch conda


    【解决方案1】:

    我的问题是它是一台 CPU 机器,因此没有安装 CUDA。在这种情况下,您需要安装pytorch-cpu

    conda install -c pytorch pytorch-cpu
    

    之后,它工作正常。

    (感谢@JuanFMontesinos on the pytorch forum

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-09-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-05-10
      • 2014-01-25
      相关资源
      最近更新 更多