【文章复现记录】物体姿态检测BundleSDF、BundleTrack、se(3)TrackNet

文章介绍了作者在复现物体姿态检测领域的两个项目(BundleSDF和BundleTrack)时遇到的技术问题,包括构建环境中的libfreeimage.so缺失、CUDA版本不匹配、显存限制等,并提供了相应的解决方案。
摘要由CSDN通过智能技术生成

前言

本文复现的论文都是出自同一位作者,主要研究的问题是物体姿态检测,其中有基于CAD模型的、不基于CAD模型的方法到模型重建的方法,值得学习。

BundleSDF

一、构建环境

项目地址:https://github.com/NVlabs/BundleSDF
BundleSDF中没有提供官方的docker image,需要自己构建。构建过程中可能会遇到以下问题:

  1. 缺少libfreeimage.so文件。解决方法:下载该文件,修改dockerfile,将文件从本机复制过去

    #git clone https://github.com/imageio/imageio-binaries.git #需要的文件在这个仓库里
    # 在docker file中添加
    COPY ./imageio-binaries/freeimage/libfreeimage-3.16.0-linux64.so /.imageio/freeimage
    #RUN imageio_download_bin freeimage
    
  2. 下载对应包时速度较慢。解决方法:更换 pip 源

    # 在docker file中添加
    pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple &&\
    

接下来需要在容器中启动显卡,需要下载相应的驱动:

# nvidia-container-runtime-script.sh

sudo curl -s -L https://nvidia.github.io/nvidia-container-runtime/gpgkey | \
  sudo apt-key add -
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
sudo curl -s -L https://nvidia.github.io/nvidia-container-runtime/$distribution/nvidia-container-runtime.list | \
  sudo tee /etc/apt/sources.list.d/nvidia-container-runtime.list
sudo apt-get update

bash nvidia-container-runtime-script.sh
sudo apt-get install -y nvidia-container-toolkit
which nvidia-container-runtime
systemctl restart docker

二、推理

  1. `GLIBCXX_3.4.29’ not found

    ImportError: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.29’ not found (required by /opt/conda/envs/py38/lib/python3.8/site-packages/scipy/spatial/_ckdtree.cpython-38-x86_64-linux-gnu.so)

    在这里插入图片描述
    pip install scipy==1.8

  2. Unable to find a valid cuDNN algorithm to run convolution
    这里是因为显卡显存不够了,所以需要减小batch size。
    修改了 loftr_wrapper.py 中 batch_size=1

三、结果

我的显卡内存不够,所以推理示例数据时只推理了1500张左右,生成的结果保存在/path/to/output/mech_cleaned.obj&&textured_mesh.obj,在Meshlab中查看重建出来的图如下:

在这里插入图片描述

BundleTrack

项目地址:https://github.com/wenbowen123/BundleTrack
遇到的问题:

  1. illegal instruction (core dumped)
  2. OpenCV Error no kernel image is available
  3. feature detection FAIL, ERROR

由于我的显卡比较新,所以在编译时有两个注意的点:

  1. 下载镜像选择3090的Tag,因为初版使用的CUDA是10.1
  2. 编译文件时在CMakeLists.txtCUDA编译选项的代码中添加 -gencode arch=compute_86,code=sm_86

se(3)TrackNet

项目地址https://github.com/wenbowen123/iros20-6d-pose-tracking
在1660S显卡上运行报错

  1. OpenGL报错上面说

    changing -e "DISPLAY=unix:0.0" to -e "DISPLAY=$DISPLAY" in the run_container.sh

  2. 修改之后,并报了新的错:
    OpenGL.error.NullFunctionError: Attempt to call an undefined function glGenVertexArrays, check for bool(glGenVertexArrays) before calling
    解决方法:没解决,换电脑。

在4060Ti显卡上运行报错

  1. CuDNN error while running predict.sh
    解决方法:更换Pytorch和CUDA版本

    # 安装CUDA,注意这个不一定是必须的,因为在下面安装Pytorch的时候,安装了1.10+cu111版本,所以程序运行时调用的也是cu111,但我先安装了CUDA,以作记录
    # 进入安装流程时注意不要勾选安装驱动
    cat /etc/os-release # 查看Linux版本
    wget https://developer.download.nvidia.com/compute/cuda/11.3.1/local_installers/cuda_11.3.1_465.19.01_linux.run
    sudo sh cuda_11.3.1_465.19.01_linux.run
    #安装pytorch
    pip install torch==1.10.1+cu111 torchvision==0.11.2+cu111 torchaudio==0.10.1 -f https://download.pytorch.org/whl/cu111/torch_stable.html
    
    
  2. 运行容器
    run_container.sh中加入/path/to/your/se(3)TrackNet
    nvidia-docker run换成docker run --gpus all
    DISPLAY=unix:0.0不需要改

  3. 结果
    在这里插入图片描述
    在这里插入图片描述

总结

  1. 以上只是我的个人经验,不同人的设备有不同的错误出现,要多尝试
  2. 就单纯跑通代码而言,作者已经给了很详细的步骤,我们只需要耐心一些就可以,其中问题多出于自己设备版本不适配上,如CUDA、Pytroch、显卡型号、CPU型号。
  3. 跑通代码只是第一步,仍需进一步学习。
  • 24
    点赞
  • 46
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值