• 카테고리

    질문 & 답변
  • 세부 분야

    컴퓨터 비전

  • 해결 여부

    미해결

YOLOR 독학 중 질문드립니다.

22.05.07 03:08 작성 조회수 117

0

안녕하세요. 강의의 yolo 파트를 혼자 수강하고, 스스로 추가 실습으로 현재 real time detection의 sota인 YOLOR을 혼자 독학하고 있습니다.
 
5일 간 train evaluation에서 에러를 수정하지 못해서, 혹시나 하는 마음에 이렇게 도움을 요청해봅니다.
 
https://drive.google.com/file/d/1mNBu7aLV61pdet9X2dE2uGiacxFbKpAo/view?usp=sharing
 
현재 제가 작업하고 있는 colab파일인데, train까지는 문제 없이 잘 진행 됩니다. 근데 test.py를 통해서 mAP 값을 구하려고 하는데, 자꾸 에러가 뜨고, 아무리 구글링하고 찾아봐도 방법을 모르겠습니다.
 
!python test.py --data ./test.yaml --weights /content/drive/MyDrive/best.pt --img 416 --device 0
 
으로 실행시키면
Namespace(augment=False, batch_size=32, cfg='cfg/yolor_p6.cfg', conf_thres=0.001, data='./test.yaml', device='0', exist_ok=False, img_size=416, iou_thres=0.65, name='exp', names='data/coco.names', project='runs/test', save_conf=False, save_json=False, save_txt=False, single_cls=False, task='val', verbose=False, weights=['/content/drive/MyDrive/best.pt']) Using torch 1.7.0 CUDA:0 (Tesla T4, 15109MB) Model Summary: 665 layers, 36843816 parameters, 36843816 gradients, 80.379953800 GFLOPS WARNING: --img-size 416 must be multiple of max stride 64, updating to 448 Scanning labels valid/labels.cache3 (202 found, 0 missing, 70 empty, 0 duplicate, for 272 images): 272it [00:00, 21758.26it/s] Class Images Targets P R mAP@.5 mAP@.5:.95: 0% 0/9 [00:01<?, ?it/s] Traceback (most recent call last): File "test.py", line 330, in <module> save_conf=opt.save_conf, File "test.py", line 226, in test plot_images(img, output_to_target(output, width, height), paths, f, names) # predictions File "/content/yolor/utils/plots.py", line 108, in output_to_target return np.array(targets) File "/usr/local/lib/python3.7/dist-packages/torch/tensor.py", line 630, in __array__ return self.numpy() TypeError: can't convert cuda:0 device type tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first.
 
 

답변 1

답변을 작성해보세요.

1

안녕하십니까, 

이건 강의에 사용된 패키지와 다른 패키지라 제가 답을 쉽게 찾아드리기가 어려울 것 같습니다. 

저도 사용해보지 않아서 배우는데 시간이 걸릴것 같습니다.

대강 test.py를 보고는 있는데 이걸 익히려면 시간이 필요할 것 같습니다.

아쉽지만 지금 제 일정상 이걸 익혀서 문제를 해결해 드리기는 어려울 것 같습니다. 

감사합니다.