Skip to content

[BUG] - There are 2 incorrect arguments positioning in "tutorials\beginner_source\saving_loading_models.py" #3041

@davychxn

Description

@davychxn

Add Link

https://github.com/pytorch/tutorials/blob/main/beginner_source/saving_loading_models.py

Describe the bug

"weights_only" is augument of torch.load, not for model.load_state_dict
Issue at line 156 and 410.

Here is the doc:
https://pytorch.org/docs/stable/generated/torch.load.html

Describe your environment

Windows 11, PyTorch 2.4.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions