Closed senlinxiaolangtaba closed 6 years ago
python2 or python3? I only test with python2. https://pytorch.org/docs/stable/tensors.html#torch.Tensor.to
You can print DEVICE and check pytorch doc to(device, dtype=None) → Tensor
Also make sure to use pytorch=0.4.0
When I carried out the project I got this promblem: Traceback (most recent call last): File "/home/bruce/mgn/mgn/mgn.py", line 300, in
run()
File "/home/bruce/mgn/mgn/mgn.py", line 243, in run
mgn = MGN(num_classes=len(train_dataset.unique_ids)).to(DEVICE)
File "/home/bruce/.conda/envs/snowflake/lib/python3.6/site-packages/torch/nn/modules/module.py", line 393, in to
return self._apply(lambda t: t.to(device))
File "/home/bruce/.conda/envs/snowflake/lib/python3.6/site-packages/torch/nn/modules/module.py", line 176, in _apply
module._apply(fn)
File "/home/bruce/.conda/envs/snowflake/lib/python3.6/site-packages/torch/nn/modules/module.py", line 176, in _apply
module._apply(fn)
File "/home/bruce/.conda/envs/snowflake/lib/python3.6/site-packages/torch/nn/modules/module.py", line 182, in _apply
param.data = fn(param.data)
File "/home/bruce/.conda/envs/snowflake/lib/python3.6/site-packages/torch/nn/modules/module.py", line 393, in
return self._apply(lambda t: t.to(device))
TypeError: to() received an invalid combination of arguments - got (device), but expected one of: