Open 2hyes opened 3 years ago
안녕하세요. 우선 제 리포지토리를 사용해주셔서 감사합니다. 이 문제는 train할 때, groundtruth를 불러와 넣어주면서 발생하는 오류입니다. 제 예상으로는 입출력 shape 불일치, class 번호가 0 ~ 1이 아님 등으로 생각합니다. 저도 버그를 살펴보겠지만, 도움이 되실 자료를 올려드립니다. https://ndb796.tistory.com/509 https://brstar96.github.io/shoveling/device_error_summary/
사실 이 코드는 VOC, COCO 데이터셋을 기반으로 작성되어 커스텀 데이터셋은 생각해보지 않았는데, 한번 다시 살펴봐야겠네요. 감사합니다.
제가 예전에 yolov3 코드를 작성할 때 참고했던 리포지토리가 있습니다. https://github.com/ultralytics/yolov3 코드 완성도가 높지만 사용법이 살짝 더 어렵습니다. 커스텀 데이터셋을 사용하신다면 이 리포지토리도 큰 도움이 되실거라 생각해요! https://github.com/ultralytics/yolov3/wiki/Train-Custom-Data
답변감사합니다!
검색해보면서 찾은 정보인데 도움이 될까하여 남깁니다! https://github.com/eriklindernoren/PyTorch-YOLOv3/issues/157
저 + 같은 이슈를 가지신 분들의 많은 경우, valid한 박스 혹은 label정보를 갖고있지않았어서 생기는 에러인 것 같습니다. 해당 링크 중간즈음에 남겨주신 분처럼
b, target_labels = target[:, :2].long().t()
gx, gy = gxy.t()
gw, gh = gwh.t()
gi, gj = gxy.long().t()
########## TODO(arthur77wang):
gi[gi < 0] = 0
gj[gj < 0] = 0
gi[gi > nG - 1] = nG - 1
gj[gj > nG - 1] = nG - 1
###################
# Set masks
obj_mask[b, best_n, gj, gi] = 1
noobj_mask[b, best_n, gj, gi] = 0
코드를 추가하면 에러가 해결됩니다. 다만, 에러를 잡는 용도라서 학습에 문제가 생길 수 있을 것 같다는 생각이 들어, bbox valid 코드를 추가하는 것을 고려하고있습니다.
1개의 class(사람)만을 detect하려고 커스텀 데이터셋을 학습 시키고자 합니다. data/.names, config/.data, data/train.txt, data/val.txt모두 수정했고 train.py의 argument부분도 모두 수정했습니다.
utils.py의 build_targets 함수에서 이런 오류가 나고있습니다. coco 데이터셋으로는 나지않았던 오류라, 혹시 같은 오류의 경험이 있으실까하여 올려봅니다!