can't convert cuda:0 device type tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first.

YoungJoon Suh·2022년 9월 2일
0

correct += (predicted.cpu() == labels.cpu()).sum()
tensor 값에 .cpu()를 붙여서 비교해야 제목의 에러가 사라진다.

profile
저는 서영준 입니다.

0개의 댓글

관련 채용 정보