Traceback (most recent call last):
File "main.py", line 541, in
processor.start()
File "main.py", line 482, in start
self.train(epoch, save_model=True)
File "main.py", line 370, in train
output = self.model(data)
File "/home/Liutl/anaconda3/envs/sgcn/lib/python3.7/site-packages/torch/nn/modules/module.py", line 532, in call
result = self.forward(*input, **kwargs)
File "/home/Liutl/anaconda3/envs/sgcn/lib/python3.7/site-packages/torch/nn/parallel/data_parallel.py", line 151, in forward
replicas = self.replicate(self.module, self.device_ids[:len(inputs)])
File "/home/Liutl/anaconda3/envs/sgcn/lib/python3.7/site-packages/torch/nn/parallel/data_parallel.py", line 156, in replicate
return replicate(module, device_ids, not torch.is_grad_enabled())
File "/home/Liutl/anaconda3/envs/sgcn/lib/python3.7/site-packages/torch/nn/parallel/replicate.py", line 146, in replicate
setattr(replica, key, Parameter(param))
File "/home/Liutl/anaconda3/envs/sgcn/lib/python3.7/site-packages/torch/nn/parameter.py", line 26, in new
return torch.Tensor._make_subclass(cls, data, requires_grad)
RuntimeError: Only Tensors of floating point dtype can require gradients
您好 我在使用两张卡运行时会出现这个错误:
Traceback (most recent call last): File "main.py", line 541, in
processor.start()
File "main.py", line 482, in start
self.train(epoch, save_model=True)
File "main.py", line 370, in train
output = self.model(data)
File "/home/Liutl/anaconda3/envs/sgcn/lib/python3.7/site-packages/torch/nn/modules/module.py", line 532, in call
result = self.forward(*input, **kwargs)
File "/home/Liutl/anaconda3/envs/sgcn/lib/python3.7/site-packages/torch/nn/parallel/data_parallel.py", line 151, in forward
replicas = self.replicate(self.module, self.device_ids[:len(inputs)])
File "/home/Liutl/anaconda3/envs/sgcn/lib/python3.7/site-packages/torch/nn/parallel/data_parallel.py", line 156, in replicate
return replicate(module, device_ids, not torch.is_grad_enabled())
File "/home/Liutl/anaconda3/envs/sgcn/lib/python3.7/site-packages/torch/nn/parallel/replicate.py", line 146, in replicate
setattr(replica, key, Parameter(param))
File "/home/Liutl/anaconda3/envs/sgcn/lib/python3.7/site-packages/torch/nn/parameter.py", line 26, in new
return torch.Tensor._make_subclass(cls, data, requires_grad)
RuntimeError: Only Tensors of floating point dtype can require gradients
您知道如何解决么?