无法导入fastai[WinError 126]指定的模块无法找到



首先运行以下命令:conda install -c pytorch -c fastai fastai。CCD_ 2。我导入这个:

from fastai.imports import *

我有一个error像这样:

Traceback (most recent call last):
File "C:UsersacerDesktopReddit Botdemo.py", line 70, in <module>
from fastai.imports import *
File "C:Usersaceranaconda3libsite-packagesfastaiimports__init__.py", line 2, in <module>
from .torch import *
File "C:Usersaceranaconda3libsite-packagesfastaiimportstorch.py", line 1, in <module>
import torch, torch.nn.functional as F
File "C:Usersaceranaconda3libsite-packagestorch__init__.py", line 81, in <module>
ctypes.CDLL(dll)
File "C:Usersaceranaconda3libctypes__init__.py", line 364, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] The specified module could not be found

我在stackoverflow上看了一些帖子,但无法解决这个问题。我该如何解决这个问题?请帮帮我。

如果你像我一样使用没有NVIDIA GPU卡的机器,可能会发生这种情况。conda install -c pytorch -c fastai fastai将安装一个使用GPU的版本。

为了解决这个问题,我卸载了pytorch,然后conda使用conda install pytorch torchvision cpuonly -c pytorch.安装了CPU版本。这对我很有效!您可以在官方网站上查看pytorch安装指南:(

最新更新