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

Use weights_only for load #200

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions spot_rl_experiments/spot_rl/real_policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def __init__(
)
else:
if isinstance(checkpoint_path, str):
checkpoint = torch.load(checkpoint_path, map_location="cpu")
checkpoint = torch.load(checkpoint_path, map_location="cpu", weights_only=True)
else:
checkpoint = checkpoint_path

Expand Down Expand Up @@ -461,7 +461,7 @@ def __init__(
),
}
)
checkpoint = torch.load(mixer_checkpoint_path, map_location="cpu")
checkpoint = torch.load(mixer_checkpoint_path, map_location="cpu", weights_only=True)
checkpoint["config"].RL.POLICY["nav_checkpoint_path"] = nav_checkpoint_path
checkpoint["config"].RL.POLICY["gaze_checkpoint_path"] = gaze_checkpoint_path
checkpoint["config"].RL.POLICY["place_checkpoint_path"] = place_checkpoint_path
Expand Down
2 changes: 1 addition & 1 deletion spot_rl_experiments/utils/pytorch_to_torchscript.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def __init__(
self.device = torch.device(device)

# Load the checkpoint
checkpoint = torch.load(checkpoint_path, map_location="cpu")
checkpoint = torch.load(checkpoint_path, map_location="cpu", weights_only=True)

# Load the config
config = checkpoint["config"]
Expand Down