티스토리 뷰

python3 -m pip install easydict tensorboardX shapely​
docker run --gpus=all ..... 필요한 options, images, mount할 folder 등등

 

1. python3 data/kitti_split1/setup_split.py 실행하기

apt-get update
apt-get install python3
apt-get install python3-pip
mkdir data/kitti
ln -s /workspace/Kitti/object/testing data/kitti/
ln -s /workspace/Kitti/object/training data/kitti/
python3 -m pip install scipy matplotlib tqdm
python3 -m pip install --upgrade pip setuptools wheel
python3 -m pip install opencv-python
python3 -m pip install torch==0.4.1
apt-get install libgl1-mesa-glx
python3 data/kitti_split1/setup_split.py

Linking train
Linking val
Done 가 나오면서 setup_split.py 가 실행이 됨.

 

2. sh data/kitti_split1/devkit/cpp/build.sh 실행하기

apt-get install libboost-dev
sh data/kitti_split1/devkit/cpp/build.sh

 

3. cd lib/nms/ and make 실행하기

cd lib/nms
python3 -m pip install cython
make

python3 setup.py build_ext --inplace
running build_ext
skipping 'cpu_nms.c' Cython extension (up-to-date)
skipping 'gpu_nms.cpp' Cython extension (up-to-date)
rm -rf build 가 나오면서 실행이 잘 됨.

 

4. cd model/DCNv2 and sh ./make.sh 실행하기

 cd ../../model/DCNv2/
python3 -m pip install cffi
sh ./make.sh

까지 실행 ㅇㅋ

 

5. training code 실행

cd ../..
python3 -m pip install easydict tensorboardX shapely
python3 scripts/train_rpn_3d.py --config=kitti_3d_base --exp_name base

이거 수행했더니... 드디어 에러... ㅇㅅㅇ

 

libcudart10.0 없다고 떽떽거려서 (나의 docker image는 cuda 10.2 임)

ln -s 로 softlink 만들어주면 이때까지 어느정도 해결이 되었어서 항상 이런식으로 10.0 을 만들어줬는데 

이번에는 이게 통하지 않았다.... ㅈㅇ가 그냥 dockerfile로 만들어놓고 다시 image랑 container 만들어서 쓰라고해서 

위 내용을 쭉 (apt-get과 python3 -m pip install commands들을 위주로) dockerfile에 쓰고 다시 image를 만들었다.

 

Dockerfile의 base image는 

nvidia/cuda:10.0-cudnn7-devel-ubuntu18.04로 설정하였다.

 

그랬더니 libcudart.so.10.0 문제는 무사 통과.  그러나 여러가지 package를 설치해줘야해서 아직 training command를 실행할 수 없다.

python3 -m pip install scikit-image numba

 

여기까지 하고나면 package에 대한 error는 전부 해결.

그러나... 이제는 code error가 나기 시작한다^_^

 

 

Error1.  

File "/workspace/lib/rpn_util.py", line 114, in generate_anchors         
    ols = iou(anchors[:, 0:4], normalized_gts[:, 0:4])                        
IndexError: too many indices for array: array is 1-dimensional, but 2 were indexed            

 

원인

normalized_gts에 제대로 data를 읽어들이지 못함.

Kitti dataset에 대한 경로설정(softlink 설정) 이 잘못되어있었음.

 

Solution

나는 guide document에  ln -s /workspace/Kitti/object/testing data/kitti/ 라고 되어있어서 저대로 했는데

data/kitti_split1에 softlink를 만들어줬어야했다.

ln -s /workspace/Kitti/object/training data/kitti_split1/
ln -s /workspace/Kitti/object/testing data/kitti_split1/

로 바꿔주면 dataset 경로를 잘 찾아가서 위 error는 사라진다.

 

 

Error2.

No module named 'torchvision'

 

Solution

python3 -m pip install torchvision==0.2

 torchvision을 설치해주면 되는데 이 때, torch version과 알맞는 torchvision을 설치해주어야 한다.

찾아보니 torch==0.4.1에는 torchvision==0.2를 깔아주면 되는 것 같다.       

 

 

Error3.

ImportError: /workspace/model/DCNv2/_ext/dcn_v2/_dcn_v2.so: undefined symbol: __cudaPopCallConfiguration

cuda version 9.2로 내리라네...^_^

화나게....ㅎ 이거 9.2로 내리고 나면 또 발생하는 문제, 앞서 언급한

ImportError: libcudart.so.10.0: cannot open shared object file: No such file or directory

 libcudart.so.10.0 없다고 떽떽대는 error....

 

^_^

한참 삽질하다가 문제를 알았다. 왜 나는 9.2를 설치했는데도, 그 어디에도 10.0에 대한 언급조차 없는데 자꾸 10.0을 찾는가...

범인은... GPU였다..^__^

RTX 2080 ti 및 3090은 cuda 9.2를 지원하지 않는다.

2080 ti는 cuda 10.0부터, 3090은 내 기억이 맞다면 11부터 지원한다(3090은 틀린 정보일 수 있음)

 

^_^.....다행히 내 머신은 Heterogeneous gpu 환경이기 때문에 1080을 CUDA_VISIBLE_DEVICES로 설정해주니 되버림..

 

휴... 근데 또 문제는...Error3이 똑같이 발생한다는 것...

얘네가 날 가지고 노는지 내가 바보인지 9.0을 설치하라네. 끝까지 읽어보고 설치할걸....

https://github.com/jwyang/faster-rcnn.pytorch/issues/190

 

undefined symbol: __cudaPopCallConfiguration · Issue #190 · jwyang/faster-rcnn.pytorch

I've successfully compiled the cuda dependencies for ROI pooling. Everything looks fine but when I try to call the function RoIPoolFunction(), it comes an error: ImportError: /home/faster-rcnn....

github.com

 

 나는 이를 해결할 다른 특별한 방법이 떠오르지 않기 때문에 다시 9.0을 build해본다.

그래도 아까 ㅈㅇ가 dockerfile로 만들어놓으라고 해서 한결 쉽다. Dockerfile의 base_builder만 9.0으로 바꿔준다.

 

16.04에 python3.7이 안깔려있어서 scipy 설치부터 막혔다... python3.7 설치는 이 블로그 참조

https://softwaree.tistory.com/85

 

Ubuntu 16.04에서 Python 3.7 설치

들어가며... django를 사용하려면 Python이 최소 3.7 버전이 설치 되어 있어야 합니다. 하지만 우분투 16.04에서 지원하는 버전은 3.5이기 때문에 추가로 설치를 하여야 합니다. 본인의 PC에 설치되어 있

softwaree.tistory.com

 

9.0으로 설치하니 Error3은 해결되었다.

 

Solution

CUDA 9.0설치

 

 

아... 너무 어렵다... 더이상 못하겠다... 어떡하지 흑흑

 

 

 

 

 

 

 

공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2025/04   »
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30
글 보관함