我正在尝试使用一个非常酷的机器学习 Colab。 https://colab.research.google.com/drive/1eQLZrNYRZMo9zdnGGccE0hFswGiinO-Z?usp=sharing按原样运行他们的步骤,我不断得到
ERROR: Failed building wheel for pytorch3d
。
经过多次谷歌搜索后,我尝试将安装行替换为
!pip install 'git+https://github.com/facebookresearch/pytorch3d.git@stable'
还有
!pip install pytorch3d
前者不起作用。后者又产生了另一个问题:
"ImportError: /usr/local/lib/python3.6/dist-packages/pytorch3d/_C.cpython-36m-x86_64-linux-gnu.so: undefined symbol: _ZNK2at6Tensor7is_cudaEv"
我也尝试过做
!pip install torch==1.6.0
,这会导致
Traceback (most recent call last):
File "./meshrcnn/demo/demo.py", line 11, in <module>
from detectron2.data import MetadataCatalog
File "/usr/local/lib/python3.6/dist-packages/detectron2/data/__init__.py", line 4, in <module>
from .build import (
File "/usr/local/lib/python3.6/dist-packages/detectron2/data/build.py", line 14, in <module>
from detectron2.structures import BoxMode
File "/usr/local/lib/python3.6/dist-packages/detectron2/structures/__init__.py", line 6, in <module>
from .keypoints import Keypoints, heatmaps_to_keypoints
File "/usr/local/lib/python3.6/dist-packages/detectron2/structures/keypoints.py", line 6, in <module>
from detectron2.layers import interpolate
File "/usr/local/lib/python3.6/dist-packages/detectron2/layers/__init__.py", line 3, in <module>
from .deform_conv import DeformConv, ModulatedDeformConv
File "/usr/local/lib/python3.6/dist-packages/detectron2/layers/deform_conv.py", line 10, in <module>
from detectron2 import _C
ImportError: /usr/local/lib/python3.6/dist-packages/detectron2/_C.cpython-36m-x86_64-linux-gnu.so: undefined symbol: _ZN6caffe28TypeMeta21_typeMetaDataInstanceISt7complexIdEEEPKNS_6detail12TypeMetaDataEv
已完成
!pip install mmcv-full===1.2.1 -f https://download.openmmlab.com/mmcv/dist/cu101/torch1.7.0/index.html
尝试修复该问题,但错误仍然存在。
有人知道如何让 Colab 环境发挥作用吗?
我在 Google Colab 上也发现了同样的问题。然后我解决了它 https://github.com/facebookresearch/pytorch3d/blob/main/INSTALL.md
在此区域中,您可以看到当前机器所需的解决方案。如果您在使用 Google Colab 时遇到问题,可以尝试此代码。 一般来说,从 IPython 内部、Google Colab 或 Jupyter 笔记本中,您可以安装
import sys
import torch
pyt_version_str=torch.__version__.split("+")[0].replace(".", "")
version_str="".join([
f"py3{sys.version_info.minor}_cu",
torch.version.cuda.replace(".",""),
f"_pyt{pyt_version_str}"
])
!pip install --no-index --no-cache-dir pytorch3d -f https://dl.fbaipublicfiles.com/pytorch3d/packaging/wheels/{version_str}/download.html
安装后您必须重新启动运行时环境。就我而言,它在带有 GPU 实例的 Google Colab 中完美运行。
我遇到了同样的错误并找到了你的帖子。我尝试安装当前的主控(带有:
!pip install 'git+https://github.com/facebookresearch/pytorch3d.git'
下载并编译 pytorch3D==0.4.0 后,它实际上工作正常。 我认为解决问题的方法是下载并编译 pytorch3d,以便它与 cuda 正确链接:如果它下载预编译的轮子,您可能会收到未定义的符号错误。
我所做的唯一更改:我必须从边界矩形计算单元格中对
demo=True
的调用中删除 group_keypoints()
(它表示参数未知)