yolov7으로 evolve 하는데 에러가 났다.
Index Error: index 30 is out of bounds for axis 0 with size 30
yolov7의 train.py evolve 부분을 확인
![]() yolov5 train.py 582~606 |
![]() yolov7 train.py 664~688, error line 687 |
플로우는 거의 동일한데 hyp, meta의 값들이나 중간 중간 변수들을 선언해주는 내용이 달랐고,
조금씩 다르다보니 for문을 돌리는 과정에서 인덱스가 안 맞는것 같았다.
깃헙 이슈에서도 이미 같은 문제를 찾은 사람들이 있었고
https://github.com/WongKinYiu/yolov7/issues/999
IndexError: index 30 is out of bounds for axis 0 with size 30 for Evolve · Issue #999 · WongKinYiu/yolov7
I get an error on the second iteration of evolve when running. I havnt seen any issue mentioning this particular issue and I have had no issues running similar evolutions for Yolov5 on the same dat...
github.com
# for i, k in enumerate(hyp.keys()): # plt.hist(v.ravel(), 300) # before
for i,k in enumerate(meta): # after
hyp[k] = float(x[i + 7] * v[i]) # mutate
문제가 생기는 위치를 변경해주면서 해결할 수 있었다.
다른 해결 방법도 있었다.
https://github.com/WongKinYiu/yolov7/pull/1090
fixes in hyperparameter evolution - IndexError #1058 by Aminsaffar · Pull Request #1090 · WongKinYiu/yolov7
fixes in hyperparameter evolution - IndexError #1058
github.com
'Programming > Pytorch' 카테고리의 다른 글
torch 모델 저장 및 불러오기 (0) | 2023.03.01 |
---|---|
Resnet50 finetuning - CIFAR10 DATASET (0) | 2023.02.28 |
torch.onnx.export() option (1) | 2023.02.28 |