개발

[Pytorch] DataLoader error

내공얌냠 2020. 3. 19. 18:35

작업환경

Python : 3.6.5

CUDA : Cuda compilation tools, release 10.1, V10.1.243

Pythorch : 1.4.0

Torchvision : 0.5.0

OS : Window 10, 64bit

IDE : Pycharm Community

 

https://tutorials.pytorch.kr/beginner/data_loading_tutorial.html

진행 중 마지막 부분에서 오류 발생

 

문제

{AttributeError}'ModuleSpec' object has no attribute 'transform'

DataLoader 로 가져오는 부분에서 위와 같은 문제 발생

해결

dataloader = DataLoader(transformed_dataset, batch_size=4, shuffle=True, num_workers=0) # 4)

 

Window에서는 num_workers를 0 으로!

출처 : https://tutorials.pytorch.kr/beginner/blitz/cifar10_tutorial.html#cifar10

728x90
반응형