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

Checkpoints Save/Load from Different Devices #30

Open
FrancescoCasalegno opened this issue Apr 21, 2022 · 0 comments
Open

Checkpoints Save/Load from Different Devices #30

FrancescoCasalegno opened this issue Apr 21, 2022 · 0 comments

Comments

@FrancescoCasalegno
Copy link
Contributor

We are now fixing the torch.load() by specifying the device. However, running dvc repro on a CPU vs. GPU system would produce different artifacts. Should we also modify the code of morphoclass training to make sure that it's consistently written as CPU?
Basically I am talking about this:

def save(self, path: pathlib.Path) -> None:
"""Save the training log to disk."""
torch.save(self.to_dict(), path)

But I guess it's not trivial (maybe we need to iterate through each element of the dict and convert it?) because there's no equivalent of torch.load's map_location=device for torch.save.

Originally posted by @FrancescoCasalegno in #15 (comment)

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