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 'label_smoothing' #28

Closed
silencessss opened this issue Mar 21, 2022 · 1 comment

Comments

@silencessss
Copy link

Anyone meet this problem??? I could not deal with it.
Detail:
TypeError: init() got an unexpected keyword argument 'label_smoothing'

in main.py line 546 → criterion = create_loss_fn(args)
and
in utils.py line 32 → criterion = nn.CrossEntropyLoss(label_smoothing=args.label_smoothing)

Thanks!

@silencessss
Copy link
Author

silencessss commented Mar 30, 2022

I had been deal with it!!

My torch vision is 1.9.0. Hence, the nn.CrossEntropyLoss() is like → torch.nn.CrossEntropyLoss(weight=None, size_average=None, ignore_index=-100, reduce=None, reduction='mean').

However, the nn.CrossEntropyLoss() in troch vision 1.11.0 is like → torch.nn.CrossEntropyLoss(weight=None, size_average=None, ignore_index=- 100, reduce=None, reduction='mean', label_smoothing=0.0) .

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

1 participant