PVNet复现笔记《PVNet Pixel-Wise Voting Network for 6DoF Pose Estimation》

libceres路径问题
我采取的办法是将下载的libceres文件拷贝到/usr/local/lib中,然后在~/.bashrc文件中的LD_LIBRARY_PATH添加/usr/local/lib。

数据从onedrive下载困难的问题,没办法,科学上网!

合成图像时提示缺少transforms3d库(但是在虚拟环境中已经安装),在pycham中选择blender中的python解释器,然后在setting中添加缺失的库。
Traceback (most recent call last):
  File "/home/Storage/lxj/PoseEst/pvnet/pvnet-rendering/blender/render_backend.py", line 7, in
    from transforms3d.euler import euler2mat
ImportError: No module named 'transforms3d'
found bundled python: /home/lxj/blender-2.79b-linux-glibc219-x86_64/2.79/python
Read blend: /home/Storage/lxj/PoseEst/pvnet/pvnet-rendering/data/blank.blend

Blender quit


解决办法:当使用pycharm工具时,将程序的运行环境直接修改为blender-2.79b-linux-glibc219-x86_64中的python环境即可。

遇到:

ImportError: Something is wrong with the numpy installation. While importing we detected an older version of numpy in [‘D:\Anaconda3\envs\tensorflow\lib\site-packages\numpy’]. One method of fixing this is to repeatedly uninstall numpy until none is found, then reinstall this version.


解决办法:按照提示操作即可,重复卸载numpy,直到找不见为止。在pycharm环境中怎么办呢?在出错文件的开始位置,根据import的库,双击找到对应文件的位置,然后删除即可。按照此操作重复即可。

正常配置后,就会提示缺失文件中用到的第三方库,然后按照提示安装。有时候可能遇到从pycharm中安装不成功的情况,我采取的办法是把相同python版本环境中安装的库文件夹拷贝到我运行环境中的site-packages中,文件就可找到。

当上述库不在报错后,又出现如下错误:
Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)

解决办法:与作者沟通后,换使用虚拟环境的python版本,不再报此错误。继续下一步。

i followed your instruction and used the python from virtual environment, however, i reported following error:
>>>
/home/lxj/anaconda3/envs/tf367/bin/python /home/Storage/lxj/PoseEst/pvnet/pvnet-rendering/run.py --type rendering found bundled python: /home/lxj/blender-2.79-linux-glibc219-x86_64/2.79/python
Read blend: /home/Storage/lxj/PoseEst/pvnet/pvnet-rendering/data/blank.blend
Traceback (most recent call last):
File "/home/Storage/lxj/PoseEst/pvnet/pvnet-rendering/blender/render_backend.py", line 456, in 
batch_render_with_linemod(args, camera)
File "/home/Storage/lxj/PoseEst/pvnet/pvnet-rendering/blender/render_backend.py", line 366, in batch_render_with_linemod
bg_imgs = np.random.choice(bg_imgs, size=cfg.NUM_SYN)
File "mtrand.pyx", line 773, in numpy.random.mtrand.RandomState.choice
ValueError: 'a' cannot be empty unless no samples are taken

Successfully imported '/home/Storage/lxj/PoseEst/pvnet/pvnet-rendering/data/LINEMOD/cat/cat.ply' in 1.470 sec

Blender quit

Process finished with exit code 0
<<<


根据报错信息,得知bg_imgs值为空,检查后发现路径错误,修改后代码正常运行。

执行如下命令:
python tools/train_linemod.py --cfg_file configs/linemod_train.json --linemod_cls cat
报错:
ERROR: Unexpected bus error encountered in worker. This might be caused by insufficient shared memory (shm).
 ERROR: Unexpected bus error encountered in worker. This might be caused by insufficient shared memory (shm).
 ERROR: Unexpected bus error encountered in worker. This might be caused by insufficient shared memory (shm).
 ERROR: Unexpected bus error encountered in worker. This might be caused by insufficient shared memory (shm).
 ERROR: Unexpected bus error encountered in worker. This might be caused by insufficient shared memory (shm).
 ERROR: Unexpected bus error encountered in worker. This might be caused by insufficient shared memory (shm).
 ERROR: Unexpected bus error encountered in worker. This might be caused by insufficient shared memory (shm).
 Traceback (most recent call last):
  File "/home/Storage/lxj/PoseEst/pvnet/tools/train_linemod.py", line 358, in
    train_net()
  File "/home/Storage/lxj/PoseEst/pvnet/tools/train_linemod.py", line 342, in train_net
    train(net, optimizer, train_loader, epoch)
  File "/home/Storage/lxj/PoseEst/pvnet/tools/train_linemod.py", line 142, in train
    for idx, data in enumerate(dataloader):
  File "/home/lxj/anaconda3/envs/tf367/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 330, in __next__
    idx, batch = self._get_batch()
  File "/home/lxj/anaconda3/envs/tf367/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 309, in _get_batch
    return self.data_queue.get()
  File "/home/lxj/anaconda3/envs/tf367/lib/python3.6/multiprocessing/queues.py", line 335, in get
    res = self._reader.recv_bytes()
  File "/home/lxj/anaconda3/envs/tf367/lib/python3.6/multiprocessing/connection.py", line 216, in recv_bytes
    buf = self._recv_bytes(maxlength)
  File "/home/lxj/anaconda3/envs/tf367/lib/python3.6/multiprocessing/connection.py", line 407, in _recv_bytes
    buf = self._recv(4)
  File "/home/lxj/anaconda3/envs/tf367/lib/python3.6/multiprocessing/connection.py", line 379, in _recv
    chunk = read(handle, remaining)
  File "/home/lxj/anaconda3/envs/tf367/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 227, in handler
    _error_if_any_worker_fails()
RuntimeError: DataLoader worker (pid 9514) is killed by signal: Bus error. Details are lost due to multiprocessing. Rerunning with num_workers=0 may give better error trace.


参考网络博客,两个解决办法:一是缩小batch_size尺寸,二是减小num_worker尺寸。
检查代码后发现,作者使用多块显卡,但是我们的机器只有一块卡,将batch_size由32改为10之后可以运行(1080Ti)

到多卡服务器配置环境时:
ImportError: libspqr.so.2.0.2: cannot open shared object file: No such file or directory
在~/.bashrc中加入:
export PATH=/usr/local/cuda/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
 
export CUDA_HOME=/usr/local/cuda

后面一直提示缺少libsqrt.so.*之类库的问题,还没解决,后续更新后再放上来。
 

你可能感兴趣的:(姿态估计)