Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: __init__() got an unexpected keyword argument 'prefetch_factor' #371

Open
Schanppi opened this issue Jun 19, 2023 · 1 comment

Comments

@Schanppi
Copy link

This is not an error. If you want to use low precision, i.e., fp16, please install the apex with cuda support (https://github.com/NVIDIA/apex) and update pytorch to 1.0
[Resize(size=(256, 128), interpolation=PIL.Image.BICUBIC), Pad(padding=10, fill=0, padding_mode=constant), RandomCrop(size=(256, 128), padding=None), RandomHorizontalFlip(p=0.5), ToTensor(), Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225])]
Traceback (most recent call last):
File "train.py", line 166, in
for x in ['train', 'val']}
File "train.py", line 166, in
for x in ['train', 'val']}
TypeError: init() got an unexpected keyword argument 'prefetch_factor'

@layumi
Copy link
Owner

layumi commented Jun 19, 2023

Hi @Schanppi
prefetch_factor is introduced to the latest pytorch (I guess since pytorch 1.6/1.7 or something like that).
I am sure 1.9 has prefetch_factor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants