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

device issue says its bool not torch.deivce but i have printed the device as well it is torch.device("cuda:0") #79

Closed
msverma101 opened this issue Jan 19, 2022 · 2 comments

Comments

@msverma101
Copy link

Traceback (most recent call last):
File "example_copy.py", line 31, in
lr_finder = LRFinder(model, optimizer, criterion)
File "/home/snehaverma/anaconda3/envs/gmesh/lib/python3.6/site-packages/torch_lr_finder/lr_finder.py", line 166, in init
self.state_cacher.store("model", self.model.state_dict())
File "/home/snehaverma/anaconda3/envs/gmesh/lib/python3.6/site-packages/torch_lr_finder/lr_finder.py", line 624, in store
self.cached.update({key: copy.deepcopy(state_dict)})
File "/home/snehaverma/anaconda3/envs/gmesh/lib/python3.6/copy.py", line 180, in deepcopy
y = _reconstruct(x, memo, *rv)
File "/home/snehaverma/anaconda3/envs/gmesh/lib/python3.6/copy.py", line 306, in _reconstruct
value = deepcopy(value, memo)
File "/home/snehaverma/anaconda3/envs/gmesh/lib/python3.6/copy.py", line 161, in deepcopy
y = copier(memo)
File "/home/snehaverma/anaconda3/envs/gmesh/lib/python3.6/site-packages/torch/nn/parameter.py", line 32, in deepcopy
result = type(self)(self.data.clone(memory_format=torch.preserve_format), self.requires_grad)
File "/home/snehaverma/anaconda3/envs/gmesh/lib/python3.6/site-packages/torch/nn/parameter.py", line 153, in new
data = torch.tensor([], **factory_kwargs)
TypeError: tensor(): argument 'device' must be torch.device, not bool

@NaleRaphael
Copy link
Contributor

Hi @msverma101 ,

Can you provide the version of pytorch you are using? And if possible, a minimal code snippet to reproduce this error would be better.

@davidtvs
Copy link
Owner

davidtvs commented Feb 3, 2024

Closing due to inactivity

@davidtvs davidtvs closed this as completed Feb 3, 2024
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

3 participants