람쥐썬더

TypeError: Input type float32 is not supported 본문

에러

TypeError: Input type float32 is not supported

람쥐썬더123 2023. 4. 7. 10:13
transforms = T.Compose([
    T.ToPILImage(),
    T.Resize((cfg['IMAGE_SIZE'], cfg['IMAGE_SIZE'])),
    T.ToTensor()
])

image = plt.imread(samples[0])
image_tensor = transforms(image)

Inference를 위해 이미지 변환중 다음과 같은 에러가 났다.

 

TypeError: Input type float32 is not supported

 

 

해결 ) 

T.ToPILImage() => T.ToPILImage(mode='RGB)