[1주차] Yolo v5 모델 돌려보기

Update:     Updated:

Category:

Tags:


yolov5-crowdhuman

이번주에 한 건 맥에서 yolov5모델을 돌려보고 얼굴을 잘 인식하는지 테스트하기


Attribute 에러 처리

하라는 대로 패키지를 다운 받고 돌려봤지만 attribute 에러가 발생했다.

AttributeError: ‘Upsample’ object has no attribute ‘recompute_scale_factor’

image


해결한 방법 : python 3.8 환경에서 torch 버전이 1.10.0보다 높은 경우 발생한 에러였다. 따라서 torch 버전을 낮추거나 해당 에러 부분을 주석 처리하면 된다.

그래서 module.py에 recompute_scale_factor 부분을 주석 처리해봤더니 잘 돌아간다!

def forward(self, input: Tensor) -> Tensor:
        return F.interpolate(input, self.size, self.scale_factor, self.mode, self.align_corners,
                             #recompute_scale_factor=self.recompute_scale_factor
                             )



출력 결과

우여곡절 끝에 성공 !! 항상 모델 빌딩할 때마다 torch 버전 충돌 문제가 발생하는데, 토치랑 토치 비전의 경우 버전에 예민해서 최대한 잘 맞춰주어야 할 것 같다.

image



맨 위로 이동하기