Ubuntu16.04运行second.pytorch和PointPillars(主要记录遇到的问题)

一、环境

Ubuntu16.04
ROS-Kinetic
驱动版本384.130
CUDA:9.0.176
CUDNN:7.6.2

ROS自带
Python:3.5.2
Python: 2.7.12

Anaconda一直出现CUDA error的问题
故更换Python(最终决定使用
Python3.6.9
安装版本
Tensorflow-GPU=1.8.0
Pytorch=1.1.0

Anaconda
(base)Python3.7
Tensorflow-GPU=1.14.0
Pytorch=1.1.0
torchvision=0.3.0
——————————————————————————————————
1.SECOND for KITTI/NuScenes object detection
2.cmake3.13.2下载
3,apex
4.spconv
注:我使用的是自己创建的虚拟环境,故以下这些都是安装在虚拟环境中。
cmake安装
选择:cmake-3.13.2.tar.gz进行下载

tar xvf cmake-3.13.2.tar.gz
cd  cmake-3.13.2
./configure
make
sudo make install
检查安装版本:cmake --version
在bashrc中加入:export PATH=$PATH:/home/xxx/Downloads/ddet3d/cmake-3.13.2/bin
填写自己的路径

apex安装

$ git clone https://github.com/NVIDIA/apex
$ cd apex
$ pip install -v --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" ./

遇到问题
apex Error : Given no hashes to check 137 links for project ‘pip’: discarding no candidates
spconv安装

 $ sudo apt-get install libboost-all-dev
 $ git clone https://github.com/traveller59/spconv.git --recursive
 $ cd spconv && git checkout 7342772
 $ python setup.py bdist_wheel
 $ cd ./dist 
 $ pip  install  spconv-xxx-xxx.whl  

二、KITTI数据集准备

└── KITTI_DATASET_ROOT
       ├── training    <-- 7481 train data
       |   ├── image_2 <-- for visualization
       |   ├── calib
       |   ├── label_2
       |   ├── velodyne
       |   └── velodyne_reduced <-- empty directory
       └── testing     <-- 7580 test data
           ├── image_2 <-- for visualization
           ├── calib
           ├── velodyne
           └── velodyne_reduced <-- empty directory

运行

python create_data.py kitti_data_prep --data_path=KITTI_DATASET_ROOT

修改KITTI_DATASET_ROOT=自己的路径
这里等了很久

三、配置文件修改

train_input_reader: {
  ...
  database_sampler {
    database_info_path: "/path/to/dataset_dbinfos_train.pkl"
    ...
  }
  dataset: {
    dataset_class_name: "DATASET_NAME"
    kitti_info_path: "/path/to/dataset_infos_train.pkl"
    kitti_root_path: "DATASET_ROOT"
  }
}
...
eval_input_reader: {
  ...
  dataset: {
    dataset_class_name: "DATASET_NAME"
    kitti_info_path: "/path/to/dataset_infos_val.pkl"
    kitti_root_path: "DATASET_ROOT"
  }
}

在second.pytorch/second/ 下面有个configs文件夹,里面有每个训练参数文件的配置。

四、train 和 evaluate

python ./pytorch/train.py train --config_path=./configs/car.fhd.config --model_dir=/path/to/model_dir

笔记本电脑显卡只有1060,未训练很多次,目前只是看了下结果。
需要修改car.fhd.config的一些内容。(配环境太TM费时间了

Ubuntu16.04运行second.pytorch和PointPillars(主要记录遇到的问题)_第1张图片
注:下载了一个作者训练的模型,参数不一样?无法用?

下一步,开始看代码。

五、参考

https://github.com/traveller59/second.pytorch
https://github.com/traveller59/spconv
https://blog.csdn.net/Small_Munich/article/details/99053921
https://blog.csdn.net/weixin_40805392/article/details/100049202

注:遇到的问题(跑通SECOND,PointPillars继续研究)

遇到的问题及解决方法:
No CMAKE_CUDA_COMPILER could be found

No module named ‘second’

No module named “second”
已经能跑通,但是代码中还是无法跳转(看着像导入失败)

return t.to(device, dtype if t.is_floating_point() else None, non_blocking)
RuntimeError: CUDA error: unknown error(Anaconda出现这个问题还未解决,最后未使用Anaconda)

你可能感兴趣的:(Ubuntu16.04运行second.pytorch和PointPillars(主要记录遇到的问题))