Notice
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- 몬스터
- unity git
- 깃허브 데스크탑 합치기
- 유니티 합치기
- 유니티 해상도
- networkobject
- 유니티
- networkobject.networkid
- 깃허브 데스크탑 병합
- networkbehaviourid
- M590
- stateauthority
- unity merge
- nav오브젝트사이거리
- m590 수리
- m585 수리
- m585
- githubdesktopmerge
- 유니티 해상도 변경
- 유니티 브랜치 merge
- unity 병합
- Unity
- nav거리
- 오브젝트 깜빡임
- 유니티 해상도 설정
- NavMesh
- navigation
- Github DeskTop Merge
- 유니티 머지
Archives
- Today
- Total
집게사장의 꿈
[파이썬 / VSCode] AssertionError: Torch not compiled with CUDA enabled 본문
Yolo v3 모델을 통해 이미지 분류를 하려던 중 해당 에러가 발생하여 진행하지 못했다.
문제의 에러 블럭
command : python3 detect_1231.py --cfg cfg/yolov3-spp-403cls.cfg --names data/403food.names --weights weights/best_403food_e200b150v2.pt
===============================================================
Traceback (most recent call last):
File "C:\Users\dongs\OneDrive\문서\2023-2th\AI_DeepLearning\03.AI알고리즘 소스코드\음식분류\yolov3\detect_1231.py", line 305, in <module>
printOsInfo()
File "C:\Users\dongs\OneDrive\문서\2023-2th\AI_DeepLearning\03.AI알고리즘 소스코드\음식분류\yolov3\detect_1231.py", line 300, in printOsInfo
print('GPU :\t', torch.cuda.get_device_name(0))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\dongs\AppData\Local\Programs\Python\Python311\Lib\site-packages\torch\cuda\__init__.py", line 419, in get_device_name
return get_device_properties(device).name
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\dongs\AppData\Local\Programs\Python\Python311\Lib\site-packages\torch\cuda\__init__.py", line 449, in get_device_properties
_lazy_init() # will define _get_device_properties
^^^^^^^^^^^^
File "C:\Users\dongs\AppData\Local\Programs\Python\Python311\Lib\site-packages\torch\cuda\__init__.py", line 289, in _lazy_init
raise AssertionError("Torch not compiled with CUDA enabled")
AssertionError: Torch not compiled with CUDA enabled
여러 사이트를 돌아다닌 결과 GPU사용이 활성화 되지 않거나, 내부 라이브러리 버전이 호환되지 않아 그렇다는 것으로 문제를 인식했다.
#Yolo v5 모델에서는 작동을 잘 했기 때문에,
뭐 쿠다에 GPU 활성번호로 입력하면 된다는데, 그런건 모르겠어서 호환 문제로 해결해 보기로 했다.
우선 관련 기능 삭제
pip uninstall torch torchvision torchaudio
https://pytorch.org/get-started/previous-versions/#wheel
위 사이트에 가서 설치 링크를 받아온다.
pip install torch==2.1.0 torchvision==0.16.0 torchaudio==2.1.0 --index-url https://download.pytorch.org/whl/cu118
확실히 위에 버전과 밑에 호환되는 버전이 다른 것 같기는 하다.
결과[인식 잘 된다]
UnicodeDecodeError: 'cp949' codec can't decode byte 0xec in position 93: illegal multibyte sequence
파일 읽어들이는 인코딩 형식 문제
Traceback (most recent call last):
File "C:\Users\dongs\OneDrive\문서\2023-2th\AI_DeepLearning\03.AI알고리즘 소스코드\음식분류\yolov3\detect_1231.py", line 326, in <module>
detect()
File "C:\Users\dongs\OneDrive\문서\2023-2th\AI_DeepLearning\03.AI알고리즘 소스코드\음식분류\yolov3\detect_1231.py", line 53, in detect
model = Darknet(opt.cfg, imgsz)
^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\dongs\OneDrive\문서\2023-2th\AI_DeepLearning\03.AI알고리즘 소스코드\음식분류\yolov3\models.py", line 231, in __init__
self.module_defs = parse_model_cfg(cfg)
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\dongs\OneDrive\문서\2023-2th\AI_DeepLearning\03.AI알고리즘 소스코드\음식분류\yolov3\utils\parse_config.py", line 14, in parse_model_cfg
lines = f.read().split('\n')
^^^^^^^^
UnicodeDecodeError: 'cp949' codec can't decode byte 0xec in position 93: illegal multibyte sequence
변경 후 잘됨
'기타' 카테고리의 다른 글
[디자인 패턴] Singleton (0) | 2024.05.19 |
---|---|
클래스 다이어 그램 [UML : Class Diagram] (0) | 2024.03.07 |
Privacy Policy (0) | 2024.03.03 |
[파이썬]NotImplementedError: Could not run 'torchvision::nms' with arguments from the 'CUDA' backend (0) | 2023.11.30 |
[구글]개발자 계정 사라짐 / 없어짐 / 비활성화 / 폐쇄 (0) | 2023.02.02 |