IT skill/Python AttributeError: module 'albumentations' has no attribute 'pytorch' - 반응형 albumentations 라이브러리에서 ToTensor를 쓰려면 albumentations.pytorch를 따로 import 하여 사용해야 합니다. 이런식으로 ToTensor를 사용하면 오류가 나게 됩니다. import albumentations as A transform = A.Compose([A.pytorch.transforms.ToTensor()]) 왜 그런진 모르겠는데 이렇게 import를 해줘야 AttributeError: module 'albumentations' has no attribute 'pytorch' 에러가 발생하지 않더군요.🤔🤔 import albumentations as A import albumentations.pytorch as AP transform = A.compose([AP.transforms.ToTensor()]) 도움이 되셨다면 아무 광고나 클릭 한 번 부탁드립니다👍 반응형 공유하기 URL 복사카카오톡 공유페이스북 공유엑스 공유 게시글 관리 구독하기Beelog 저작자표시 비영리 Contents 당신이 좋아할만한 콘텐츠 TypeError: Index(...) must be called with a collection of some kind, ' ' was passed 2024.02.29 Albumentations 라이브러리 import 에러 2024.02.26 matplotlib에서 한글 깨짐 해결방법 (ubuntu) 2024.01.04 OSError: Truncated File Read 2023.12.06 댓글 0 + 이전 댓글 더보기