python - 无法导入 fastai [WinError 126] 找不到指定的模块
问题描述
首先,我运行以下命令:conda install -c pytorch -c fastai fastai
. 完成后install
。我导入这个:
from fastai.imports import *
我有一个error
这样的:
Traceback (most recent call last):
File "C:\Users\acer\Desktop\Reddit Bot\demo.py", line 70, in <module>
from fastai.imports import *
File "C:\Users\acer\anaconda3\lib\site-packages\fastai\imports\__init__.py", line 2, in <module>
from .torch import *
File "C:\Users\acer\anaconda3\lib\site-packages\fastai\imports\torch.py", line 1, in <module>
import torch, torch.nn.functional as F
File "C:\Users\acer\anaconda3\lib\site-packages\torch\__init__.py", line 81, in <module>
ctypes.CDLL(dll)
File "C:\Users\acer\anaconda3\lib\ctypes\__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安装指南:)
推荐阅读
- c# - 如何为大型项目创建集成测试
- javascript - Vue v-针对 JSON 文件中每条记录的出现
- swiftui - 为什么@Binding 属性导致每次都没有关联初始化?
- subtitle - 如何将 SRT(基于文本的字幕)转换为 DVB(基于位图的字幕)?
- google-apps-script - 检查特定文本的所有匹配列并应用时间戳
- java - 有没有办法在服务器上一次将所有 jsp 文件转换为静态页面?
- html - 尝试在标题中显示徽标
- css - 水平表单行内的 Bootstrap 4 垂直居中文本
- php - 如何在laravel中搜索给定距离和给定纬度和经度的所有位置
- php - 根目录下 index.php 中的 Laravel 5.2 恶意代码