[Ubuntu] YOLOv3 설치 과정 중 발생 오류 정리

송민영·2021년 12월 11일
0
post-thumbnail

sudo synaptic

  • 패키지 매니저. GUI로 버전관리 할 수 있음.

source ~/.bashrc

  • 아나콘다, 패키지 등을 설치한 후 설치 활성화
  • 관리자가 추가한 새 PATH 환경 변수를 현재 셸 세션에 로드

install aptitude 시 오류

  • 오류 내용
    E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable)
    E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable)

  • 현재 실행중인 커맨드 창 모두 끄고 다시 실행
    sudo killall apt apt-get

패키지 설치 시 depend 문제

https://serverfault.com/questions/1035430/install-libssl-dev-on-ubuntu-20-04-1-upgrade-from-18-04-1-reports-unmet-depend

sudo aptitude install libssl-dev

he following NEW packages will be installed:
  libssl-dev{b} 
0 packages upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 1.582 kB of archives. After unpacking 8.005 kB will be used.
The following packages have unmet dependencies:
 libssl-dev : Depends: libssl1.1 (= 1.1.1f-1ubuntu2) but 1.1.1g-1+ubuntu18.04.1+deb.sury.org+1 is installed
The following actions will resolve these dependencies:

     Keep the following packages at their current version:
1)     libssl-dev [Not Installed]                         



Accept this solution? [Y/n/q/?] n
The following actions will resolve these dependencies:

     Downgrade the following packages:                                                   
1)     libssl1.1 [1.1.1g-1+ubuntu18.04.1+deb.sury.org+1 (now) -> 1.1.1f-1ubuntu2 (focal)]



Accept this solution? [Y/n/q/?] y
The following packages will be DOWNGRADED:
  libssl1.1 
The following NEW packages will be installed:
  libssl-dev 
0 packages upgraded, 1 newly installed, 1 downgraded, 0 to remove and 0 not upgraded.
Need to get 2.900 kB of archives. After unpacking 8.087 kB will be used.
Do you want to continue? [Y/n/?] Y
  1. aptitude 설치
  2. sudo aptitude install <패키지 이름>
  3. Keep the following packages at their current version: Accept this solution? [Y/n/q/?] → n 라고 입력
  4. Downgrade the following packages: Accept this solution? [Y/n/q/?] → y 라고 입력
  5. sudo apt-get install 패키지 하면 잘 설치되는 것을 확인할 수 있다. ㅠㅠㅠㅠㅠㅠ

지금까지의 거의 모든 패키지 dependency 문제를 이렇게 해결할 수 있었을 것 같다...!!!

YOLO v3 설치 과정

make 시 cuda_runtime.h : No such file or directory

https://github.com/pjreddie/darknet/issues/753
#검색 키워드 : yolo v3 make 오류 cuda_runtime.h

cudnn.h: no such file or directory

yolo를 설치하려면 Makefile을 수정하는 과정이 필요한데, 수정 완료 후 변경된 내용을 적용하려면 make를 입력해야한다. 그런데 YOLO를 설치하기 전에 cuDNN을 제대로 설치하지 않았다면 cudnn.h: no such file or directory와 같은 에러를 만난다. 그래서 나는 CUDA부터 다시 설치했다.

wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-ubuntu1804.pin
sudo mv cuda-ubuntu1804.pin /etc/apt/preferences.d/cuda-repository-pin-600
wget https://developer.download.nvidia.com/compute/cuda/10.1/Prod/local_installers/cuda-repo-ubuntu1804-10-1-local-10.1.243-418.87.00_1.0-1_amd64.deb
sudo dpkg -i cuda-repo-ubuntu1804-10-1-local-10.1.243-418.87.00_1.0-1_amd64.deb
sudo apt-key add /var/cuda-repo-10-1-local-10.1.243-418.87.00/7fa2af80.pub
sudo apt-get update
sudo apt-get -y install cuda
  • 이후에 기본으로 사용할 CUDA 버전 지정은 https://ghostweb.tistory.com/832 을 참고했다.

    1. sudo gedit ~/.profile
    2. profile 창 마지막 칸에 아래 두 줄 입력
      export PATH=/usr/local/cuda-10.1/bin:$PATH
      export LD_LIBRARY_PATH=/usr/local/cuda-10.1/lib64:$LD_LIBRARY_PATH
    3. source ~/.profile
  • 참고자료 (cuDNN 설치~)
    https://cafepurple.tistory.com/39

cuda 다른 버전 재설치 이후에도 버전 변경이 안될 때

sudo install cuda 가 아니라
sudo install cuda-10.1 로 입력 (새로운 버전까지 추가로 작성)

설치

https://pgmrlsh.tistory.com/6?category=766787

  • 마지막 줄 실행 시 permission denied: ./linux_mark.sh 발생
    chmod +x linux_mark.sh 로 권한 부여

YOLO 안녕..

험난한 YOLO, OpenCV 환경 구축 과정과 약 10시간의 학습을 거친 후, 테스트 결과는 처참했다.
웹캠 demo에서 아무도 인식하지 못했을 뿐만 아니라
train에 사용했던 이미지에도 반응하지 않았다.
오류를 고쳐본답시고 이것 저것 건드리다보니 example 이미지를 사용해도 box가 나타나지 않았다.
아직 해결하지 못한 문제는 darknet과 build 폴더의 위치가 어디에 존재해야 하는가이다.
여기에 있던 darknet이 저기에도 똑같이 있고..
공식 문서나 구글링 결과에도 정확히 확인할 수 있는 곳이 없었다.
결국 OpenCV부터 다시 깔아보겠다고 크게 마음을 먹고
모두 지웠다가 3.2.0, 4.5 버전으로 재설치했는데 이번에는 OpenCV 설치부터 애를 먹었다.
도대체 어디서부터 꼬인걸까 .. 중간에 설치까지는 성공했다가 또 다시 설치부터 막히니까 진이 빠졌다.

얼굴'식별'에 YOLO?

진이 빠진 것과는 별개로, YOLO를 포기하게 된데에는 다른 이유가 있었다.
우리가 YOLO를 사용하고자 한 이유는 얼굴 인식때문이었는데,
얼굴의 세세한 부분을 감지해야하는 얼굴 식별의 경우 YOLO는 적합하지 않음을 깨달았음
처음 학습 결과에 반응하지 않는 이유를
나는 뭔가 설정이 잘못되어서, 동료는 학습이 덜 되어서라고 판단했는데
사실 알고보니 아예 적합하지 않은 알고리즘이었던 것이다.
YOLO가 얼굴인식에 적합하지 않은 객관적인 이유를 찾기 위해 논문들을 찾아 공부하였고,
얼굴 인식에 적합한 알고리즘 및 라이브러리를 찾을 수 있게 되었다.

사실 YOLO와 얼굴인식

0개의 댓글