강의

멘토링

커뮤니티

Inflearn Community Q&A

toyou42039588's profile image
toyou42039588

asked

From the concept of the latest deep learning technology Vision Transformer to Pytorch implementation

Learning and Evaluation

안녕하세요, vit에 관심이 많은 사람입니다.

Resolved

Written on

·

204

1

vit.ipynb 파일에서, 코드 !python vit.py --pretrained 1 --drop_rate 0.1 --weight_decay 2e-4 , 이것을 실행하였더니,Traceback (most recent call last): File "/content/gdrive/MyDrive/인프런/VisionTransformer/VisionTransformer/VisionTransformer/vit.py", line 38, in <module> image_patches, _ = iter(trainloader).next() AttributeError: '_SingleProcessDataLoaderIter' object has no attribute 'next' , 이런 에러가 발생하였는데, 어떻게 해결할 수 있을까요?

딥러닝pytorch컴퓨터-비전vision-transformer

Answer 1

0

dlbro님의 프로필 이미지
dlbro
Instructor

안녕하세요.

파이토치 버전이 변경 되면서 해당 기능이 사라졌나 보네요.

iter(trainloader).next()를 next(iter(trainloader))로 변경해서 사용하시면 됩니다.

제보 감사드립니다!

 

딥러닝호형 드림

toyou42039588's profile image
toyou42039588

asked

Ask a question