在 mac M1 上导入 torch 后出现分段错误 python

发布于 2025-01-11 12:58:09 字数 496 浏览 4 评论 0原文

我很难在我的 Mac M1 芯片上安装 pytorch。

我使用 mkl 这里

现在我这样做:

conda install ipykernel jupyter numpy pandas matplotlib nomkl 
pip install torch torchvision
python
import torch

并且我得到:

zsh:segmentation fault  python 

当我运行 jupyter 时,从终端 - 内核只是崩溃了

如何修复?

I struggled to install pytorch on my Mac M1 chip.

I fixed the previous issue with mkl here

Now I do:

conda install ipykernel jupyter numpy pandas matplotlib nomkl 
pip install torch torchvision
python
import torch

and I get:

zsh:segmentation fault  python 

from terminal, when I run jupyter - the kernel just crashes

how to fix it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

孤独岁月 2025-01-18 12:58:09

这是因为 numpy 依赖冲突,尝试这个:
首先导入 numpy,然后 torch:

import numpy;进口火炬

its because of a numpy dependency conflict, try this one:
first import numpy, and then torch:

import numpy; import torch

痞味浪人 2025-01-18 12:58:09

我刚刚遇到这个错误,mac m1,python3.8 & pyTorch 1.14。

通过此命令安装:

pip3 install --pre torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/nightly/cpu

也遇到这个错误。

以下命令帮助我解决问题

conda install "libblas==mkl"

我引用了这篇文章:
https://github.com/pytorch/pytorch/issues/66782

i just met this error, mac m1, python3.8 & pyTorch 1.14.

installed from this command:

pip3 install --pre torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/nightly/cpu

and meet this error too.

The following command help's me to solve the problem

conda install "libblas==mkl"

I refered this article:
https://github.com/pytorch/pytorch/issues/66782

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文