python - 安装 mmf 时的 torchvision 版本问题
问题描述
我正在尝试安装 Facebook 的mmf以复制 ML 竞赛Hateful Memes的基准。我正在关注此处的入门文档。
这就是我得到的:
(gpu) C:\Users\abc>pip install --upgrade --pre mmf
Collecting mmf
Using cached mmf-1.0.0rc10.tar.gz (160 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing wheel metadata ... done
ERROR: Could not find a version that satisfies the requirement torchvision==0.6.0 (from mmf) (from versions: 0.1.6, 0.1.7, 0.1.8, 0.1.9, 0.2.0, 0.2.1, 0.2.2, 0.2.2.post2, 0.2.2.post3, 0.3.0, 0.4.1, 0.5.0)
ERROR: No matching distribution found for torchvision==0.6.0 (from mmf)
ERROR: Could not find a version that satisfies the requirement torchvision==0.6.0 (from mmf) (from versions: 0.1.6, 0.1.7, 0.1.8, 0.1.9, 0.2.0, 0.2.1, 0.2.2, 0.2.2.post2, 0.2.2.post3, 0.3.0, 0.4.1, 0.5.0)
ERROR: No matching distribution found for torchvision==0.6.0 (from mmf)
如果我检查我安装的 conda 包,我可以找到:
torch 1.5.1 pypi_0 pypi
torchvision 0.6.1 pypi_0 pypi
解决方案
这是一种解决方法:
1.在安装mmf之前安装指定版本的'torch'和'torchvision'(否则会出现上述问题)
pip install torch==1.5.0 torchvision==0.6.0 -f https://download.pytorch.org/whl/torch_stable.html
无需从 pip 安装 mmf,您可以分叉存储库以获得全新的功能。但运行git clone https://github.com/facebookresearch/mmf.git
也会导致问题。
2. 运行以下命令从源代码和更改目录 fork mmf:
git clone --config core.symlinks=true https://github.com/facebookresearch/mmf.git
cd mmf
3.安装mmf:
pip install --editable .
4. [可选] 运行测试:
pytest ./tests/
推荐阅读
- angular - 如何在 Angular 中全局声明对象数组
- web-crawler - 在本地模式下运行storm crawler,不依赖zookeeper,nimbus
- kotlin - Kotlin Object OnComplete 监听器
- tmux - 是否可以使用 tmux 复制和粘贴同时粘贴到所有 tmux 窗格中?
- jupyter-notebook - 从 Lambda 函数或 Sagemaker 生命周期配置运行 .ipynb 文件
- javascript - 拆分空格并选择第二个项目
- php - RouteCollection.php 第 200 行中的 MethodNotAllowedHttpException:
- html - 如何在 Html 中将 Textarea 更改为 Textbox
- python - makemigrations 响应 指定 app_label 时未检测到更改
- c++ - 在 C++ 中将 16 位值转换为 32 位值