모도리는 공부중

[PYTHON] retinanet 학습 중에 만난 오류들 본문

내 지식 정리/PYTHON

[PYTHON] retinanet 학습 중에 만난 오류들

공부하는 모도리 2021. 4. 7. 20:05
728x90
반응형

dlerror: cudart64_110.dll not found

(project) D:\3rd_Deep\keras-retinanet-master>python keras_retinanet/bin/train.py --gpu=0 --epochs=10 --steps=1000 --workers=0 csv D:/3rd_Deep/reinanet_modeling/annotation.csv D:\3rd_Deep\reinanet_modeling/classmapping.csv
2021-04-07 16:20:13.646084: W tensorflow/stream_executor/platform/default/dso_loader.cc:60] Could not load dynamic library 'cudart64_110.dll'; dlerror: cudart64_110.dll not found
2021-04-07 16:20:13.650038: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
Traceback (most recent call last):
  File "keras_retinanet/bin/train.py", line 34, in <module>
    from .. import layers  # noqa: F401
  File "keras_retinanet/bin\..\..\keras_retinanet\layers\__init__.py", line 1, in <module>
    from ._misc import RegressBoxes, UpsampleLike, Anchors, ClipBoxes  # noqa: F401
  File "keras_retinanet/bin\..\..\keras_retinanet\layers\_misc.py", line 20, in <module>
    from ..utils import anchors as utils_anchors
  File "keras_retinanet/bin\..\..\keras_retinanet\utils\anchors.py", line 20, in <module>
    from ..utils.compute_overlap import compute_overlap
  File "keras_retinanet\utils\compute_overlap.pyx", line 1, in init keras_retinanet.utils.compute_overlap
    # --------------------------------------------------------
ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 88 from C header, got 80 from PyObject

retinanet을 포기하지 않고... 어떻게든 해보려고 열심히 라벨링하여 시도하는데 발생한 에러.

 

검색해보니 이걸 설치하면 된다는 문구 발견.

 

CUDA Toolkit 11.0 Download

Select Target Platform Click on the green buttons that describe your target platform. Only supported platforms will be shown. By downloading and using the software, you agree to fully comply with the terms and conditions of the CUDA EULA. Operating System

developer.nvidia.com

설치 후 retinanet 학습시킬 코드 실행

python keras_retinanet/bin/train.py --gpu=0 --epochs=10 --steps=1000 --workers=0 csv D:/3rd_Deep/reinanet_modeling/annotation.csv D:\3rd_Deep\reinanet_modeling/classmapping.csv

 

여전히 같은 오류...

 

 

 

결국 가상환경을 새로 만들어서 retinanet을 재설치했다.

재설치 방법은 하단 링크 참고

 

[PYTHON] ANACONDA에서 RETINANET 설치

Retinanet 환경설정 아래 과정은 anaconda에서 cmd(명령프롬프트)를 실행하여 진행하였습니다. 가상환경은 cmd를 이용하지 않고 anaconda navigator를 이용하였으며 파이썬은 3.7로 설정하였습니다. Retinanet

studying-modory.tistory.com

 

재설치 후 달라진 오류 내용.

(assult) D:\3rd_Deep\keras-retinanet-master>python keras_retinanet/bin/train.py --gpu=0 --epochs=10 --steps=1000 --workers=0 csv D:/3rd_Deep/reinanet_modeling/annotation.csv D:\3rd_Deep\reinanet_modeling/classmapping.csv
2021-04-07 19:22:12.247250: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cudart64_110.dll
Traceback (most recent call last):
  File "keras_retinanet/bin/train.py", line 38, in <module>
    from ..callbacks.eval import Evaluate
  File "keras_retinanet/bin\..\..\keras_retinanet\callbacks\eval.py", line 18, in <module>
    from ..utils.eval import evaluate
  File "keras_retinanet/bin\..\..\keras_retinanet\utils\eval.py", line 18, in <module>
    from .visualization import draw_detections, draw_annotations
  File "keras_retinanet/bin\..\..\keras_retinanet\utils\visualization.py", line 17, in <module>
    import cv2
ModuleNotFoundError: No module named 'cv2'

그리고 매번 오류가 달라진다. 없다는 모듈들을 모두 재설치했더니 이번에 뜬 오류는...

Traceback (most recent call last):
  File "keras_retinanet\bin\train.py", line 553, in <module>
    main()
  File "keras_retinanet\bin\train.py", line 483, in main
    train_generator, validation_generator = create_generators(args, backbone.preprocess_image)
  File "keras_retinanet\bin\train.py", line 303, in create_generators
    **common_args
  File "keras_retinanet\bin\..\..\keras_retinanet\preprocessing\csv_generator.py", line 147, in __init__
    raise_from(ValueError('invalid CSV class file: {}: {}'.format(csv_class_file, e)), None)
  File "<string>", line 3, in raise_from
ValueError: invalid CSV class file: D:\3rd_Deep\reinanet_modeling\classmapping.csv: line 1: malformed class ID: invalid literal for int() with base 10: 'number'

이유가 무얼꼬... 생각보다 간단히 해결됐다. 컬럼명이 없어야한다. 컬럼명을 싹 다 지우고 다시 진행해보니,

드디어 진행되고 있다. steps를 1000으로 준 관계로 .... 오늘 내로는 안 끝날 것 같다. ^^;;;;

 

728x90
반응형
Comments