반응형

AttributeError 2

[에러노트/파이썬] AttributeError: 'Image' object has no attribute 'shape'

AttributeError: 'Image' object has no attribute 'shape'에러노트: 제가 직접 겪었던 에러와 해결 방법에 대해 소개합니다.에러파이썬에서 아래와 같이 laod_img를 통하여 이미지를 불러오고, 이미지의 크기를 조회하기 위해 shape를 사용했는데, 다음과 같은 에러가 발생했다.AttributeError: 'Image' object has no attribute 'shape'from keras_preprocessing.image import load_imgfilename = 'output_20240301_V0000.png'sample_img = load_img(filename)sample_img.shape해결확인한 결과, shape이라는 속성이 없다는 경고문이었다...

Python/Error 2025.04.18

[에러노트/파이썬] AttributeError: 'NoneType' object has no attribute 'append'

AttributeError: 'NoneType' object has no attribute 'append'에러노트: 제가 직접 겪었던 에러와 해결 방법에 대해 소개합니다.에러리스트에 요소를 추가하기 위해 append를 사용했는데, 다음과 같은 에러가 발생했다. 아래 코드는 실제 데이터가 아닌 sample이라는 리스트를 임의로 생성하여 작성하였다. 1부터 10까지의 숫자가 들어있는 리스트에 11과 12를 추가하여 sample 변수에 할당했더니 에러가 발생했다.AttributeError: 'NoneType' object has no attribute 'append'sample = [1,2,3,4,5,6,7,8,9,10]sample = sample.append(11)sample = sample.append(1..

Python/Error 2025.03.26
반응형