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

[refactor] basis_keys to list #23

Merged
merged 1 commit into from
Nov 17, 2024
Merged

Conversation

Chokyotager
Copy link
Contributor

@Chokyotager Chokyotager commented Nov 16, 2024

Cast basis keys to list so it can be serialised in torch.save()

If not, this happens (tested on PyTorch 2.5.1+cu124)

torch.save(model, "test.pt")
Traceback (most recent call last):
File "", line 1, in
File "/home/hilbert/miniconda3/envs/.../lib/python3.11/site-packages/torch/serialization.py", line 850, in save
_save(
File "/home/hilbert/miniconda3/envs/.../lib/python3.11/site-packages/torch/serialization.py", line 1088, in _save
pickler.dump(obj)
TypeError: cannot pickle 'dict_keys' object

Changed basis keys to list so it can be serialised in torch.save()
@lucidrains
Copy link
Owner

@Chokyotager thanks Hilbert!

@lucidrains lucidrains merged commit 1a474e1 into lucidrains:main Nov 17, 2024
1 check failed
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

Successfully merging this pull request may close these issues.

2 participants