본문 바로가기

CS/AI | CV

YOLOv5 in PyTorch - Train Custom Data #2

데이터셋 정의해주기 

 

 

 

 

 

train과 val을 같은 데이터셋으로 넣었는데 원래는 이렇게 하면 과적합 문제가 일어날 수 있다

그냥 연습용으로 지정해주었다

 

 

 

 

 

모델 훈련시키기

값들을 적절하게 설정해준다

 

 

 

 

 

임포트 에러,,

 

 

 

 

 

https://exerror.com/importerror-cannot-import-name-_registermattype-from-cv2-cv2/#:~:text=cv2'%20Error%20%3F-,To%20Solve%20ImportError%3A%20cannot%20import%20name%20'_registerMatType'%20from%20',thats%20why%20this%20error%20occurs.

 

[Solved] ImportError: cannot import name '_registerMatType' from 'cv2.cv2' - Exception Error

To Solve ImportError: cannot import name '_registerMatType' from 'cv2.cv2' Error You just have to Downgrade opencv-python-headless to the 4.1.

exerror.com

opencv-python-headless 를 uninstall 하고

다시 버전 낮춰서 install하면 된다

 

 

 

 

opencv-python-headless  uninstall

 

 

 

 

 

근데 링크에서 본 버전으로 해주려니까 해당하는 버전이 없다..?

 

 

 

 

 

https://github.com/opencv/opencv-python/issues/591

 

ImportError: cannot import name '_registerMatType' from 'cv2.cv2' · Issue #591 · opencv/opencv-python

Trying to import cv2 in python 3.9.2 gives me the following error: File "C:\Users\My Name\AppData\Local\Programs\Python\Python39\lib\site-packages\cv2_init_.py", line 9, in from .cv2 impo...

github.com

pip install opencv-python-headless==3.4.17.61

이슈보니까 4.3 전 버전이면 된다고 해서

적당히 3.4.17.61로 해주었다

 

 

 

 

설치 완!

 

 

 

 

다시 훈련

 

 

 

 

 

argument 입맛에 맞게 변형해서 훈련시켜준다

 

 

 

 

 

원래 모델에 오버라이딩 되었다

 

 

 

 

 

내 너무 작고.. 소중한 이미지 9장

ㅋㅋ..

그 와중에 19151512-흰색-배경-앞의-귀여운-순종-강아지-치와와의-초상화 not found된 거 넘 킹받구,, 웃겨,,

 

 

 

 

 

ㅋㅋㅋㅋㅋㅋㅋㅋㅋ네이밍 누가했냐!

 

 

 

 

 

yolov5에 가보면 yolov5.pt 파일 생긴 걸 볼 수 있다

 

 

 

 

 

weights에 pt파일 안만들어진 거 kg받아,...

 

 

 

 

 

https://github.com/ultralytics/yolov5/issues/3351

 

Unable to save best.pt file in run/train/exp/weights folder · Issue #3351 · ultralytics/yolov5

❔Question I have been training the yolov5 for my custom dataset but it is unable to save best.pt checkpoint. I trained it almost 3 times, thinking that it is an issue with the notebook. Please, hel...

github.com

--nosave flag 때문일까요..?

 

 

 

 

다으메 계속

'CS > AI | CV' 카테고리의 다른 글

Yolov4 Object detection on Linux  (0) 2022.02.18
YOLOv5 in PyTorch - Train Custom Data #1  (0) 2022.02.16
Face Recognition - Progressive Web App 제작  (0) 2021.10.30
Tensorflow Lite Digit Classifier 실습  (0) 2021.10.25
Hybrid app 개발 Ionic  (0) 2021.10.21

Tiny Star