[Python]TypeError: image must be numpy array type(Resnet)

2022. 10. 27. 12:32·Development/Python

⚠️ 에러 상황

 

✅ 해결 방법

image를 불러올 때 np.array로 불러오기

np.array(Image.open(image_path))

 

 resnet 모델을 사용하여 transform을 적용한 경우 아래와 같이 reutrn

if self.transform:
	image = self.transform(image=image)
return image['image']
728x90
저작자표시 비영리 변경금지 (새창열림)

'Development > Python' 카테고리의 다른 글

[Python]Poetry 설치 방법(Window)  (0) 2023.01.15
[Python]ImportError: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version 'GLIBCXX_3.4.26' not found  (0) 2022.12.26
[Python]requirements.txt로 패키지 관리하기  (0) 2022.11.09
[Python]ImportError: cannot import name 'Concatenate' from 'typing_extensions'  (0) 2022.10.26
'Development/Python' 카테고리의 다른 글
  • [Python]Poetry 설치 방법(Window)
  • [Python]ImportError: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version 'GLIBCXX_3.4.26' not found
  • [Python]requirements.txt로 패키지 관리하기
  • [Python]ImportError: cannot import name 'Concatenate' from 'typing_extensions'
iihye_
iihye_
  • iihye_
    hye-log
    iihye_
    • 분류 전체보기 (296)
      • Development (19)
        • Spring (4)
        • Python (5)
        • React (4)
        • Next.js (1)
        • JavaScript (4)
        • CSS (1)
      • Infra (15)
        • Docker (1)
        • Jenkins (2)
        • Nginx (3)
        • JBoss (1)
        • Windows (3)
        • Linux (3)
        • Kafka (2)
      • Database (1)
        • MongoDB (1)
      • Tools (2)
        • Git (0)
        • Github (1)
        • Document (1)
      • CodingTest (125)
        • Programmers (38)
        • Baekjoon (52)
        • SWEA (27)
        • Jungol (4)
        • Codetree (1)
        • Goorm (3)
      • Education (99)
        • SSAFY 10기 (5)
        • AI Tech 4기 (94)
      • NomadCoder (35)
        • (JS)크롬 앱 만들기 (35)
      • Notice (0)
  • 링크

    • Github
  • 인기 글

  • 최근 글

  • 전체
    오늘
    어제
  • hELLO· Designed By정상우.v4.10.5
iihye_
[Python]TypeError: image must be numpy array type(Resnet)
상단으로

티스토리툴바