davidtvs / pytorch-lr-finder

A learning rate range test implementation in PyTorch
MIT License
921 stars 120 forks source link

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 closed 9 months ago

msverma101 commented 2 years ago

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 commented 2 years ago

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 commented 9 months ago

Closing due to inactivity