I run successfully python3 main.py but when I test, then got error. Can you fix it please?
~$ python -m DeepCORAL.tests.test -v
(pytorch_python3) user@PA00074589:~$ python -m DeepCORAL.tests.test -v
test_CORAL_backward (main.TestCORAL) ... ERROR
test_CORAL_forward (main.TestCORAL) ... ERROR
test_feature_covariance_mat (main.TestCORAL) ... ERROR
test_forbenius_norm (main.TestCORAL) ... ok
======================================================================
ERROR: test_CORAL_backward (main.TestCORAL)
Traceback (most recent call last):
File "/home/user/DeepCORAL/tests/test.py", line 37, in test_CORAL_backward
valid = torch.autograd.gradcheck(coral, test[x], eps=1e-3)
File "/home/user/pytorch_python3/lib/python3.5/site-packages/torch/autograd/gradcheck.py", line 154, in gradcheck
output = func(*inputs)
File "/home/user/DeepCORAL/models.py", line 31, in forward
cs = feature_covariance_mat(ns, source)
File "/home/user/DeepCORAL/models.py", line 13, in feature_covariance_mat
tmp = ones_t.matmul(d)
File "/home/user/pytorch_python3/lib/python3.5/site-packages/torch/tensor.py", line 180, in matmul
return torch.matmul(self, other)
File "/home/user/pytorch_python3/lib/python3.5/site-packages/torch/functional.py", line 173, in matmul
return torch.mm(tensor1, tensor2)
TypeError: torch.mm received an invalid combination of arguments - got (torch.cuda.FloatTensor, torch.FloatTensor), but expected one of:
- (torch.cuda.FloatTensor source, torch.cuda.FloatTensor mat2)
didn't match because some of the arguments have invalid types: (torch.cuda.FloatTensor, torch.FloatTensor)
- (torch.cuda.sparse.FloatTensor source, torch.cuda.FloatTensor mat2)
didn't match because some of the arguments have invalid types: (torch.cuda.FloatTensor, torch.FloatTensor)
======================================================================
ERROR: test_CORAL_forward (main.TestCORAL)
Traceback (most recent call last):
File "/home/user/DeepCORAL/tests/test.py", line 29, in test_CORAL_forward
res = coral.forward(*test[x])
File "/home/user/DeepCORAL/models.py", line 31, in forward
cs = feature_covariance_mat(ns, source)
File "/home/user/DeepCORAL/models.py", line 13, in feature_covariance_mat
tmp = ones_t.matmul(d)
File "/home/user/pytorch_python3/lib/python3.5/site-packages/torch/tensor.py", line 180, in matmul
return torch.matmul(self, other)
File "/home/user/pytorch_python3/lib/python3.5/site-packages/torch/functional.py", line 173, in matmul
return torch.mm(tensor1, tensor2)
TypeError: torch.mm received an invalid combination of arguments - got (torch.cuda.FloatTensor, torch.FloatTensor), but expected one of:
- (torch.cuda.FloatTensor source, torch.cuda.FloatTensor mat2)
didn't match because some of the arguments have invalid types: (torch.cuda.FloatTensor, torch.FloatTensor)
- (torch.cuda.sparse.FloatTensor source, torch.cuda.FloatTensor mat2)
didn't match because some of the arguments have invalid types: (torch.cuda.FloatTensor, torch.FloatTensor)
======================================================================
ERROR: test_feature_covariance_mat (main.TestCORAL)
Traceback (most recent call last):
File "/home/user/DeepCORAL/tests/test.py", line 20, in test_feature_covariance_mat
res = feature_covariance_mat(*test[x])
File "/home/user/DeepCORAL/models.py", line 13, in feature_covariance_mat
tmp = ones_t.matmul(d)
File "/home/user/pytorch_python3/lib/python3.5/site-packages/torch/tensor.py", line 180, in matmul
return torch.matmul(self, other)
File "/home/user/pytorch_python3/lib/python3.5/site-packages/torch/functional.py", line 173, in matmul
return torch.mm(tensor1, tensor2)
TypeError: torch.mm received an invalid combination of arguments - got (torch.cuda.FloatTensor, torch.FloatTensor), but expected one of:
- (torch.cuda.FloatTensor source, torch.cuda.FloatTensor mat2)
didn't match because some of the arguments have invalid types: (torch.cuda.FloatTensor, torch.FloatTensor)
- (torch.cuda.sparse.FloatTensor source, torch.cuda.FloatTensor mat2)
didn't match because some of the arguments have invalid types: (torch.cuda.FloatTensor, torch.FloatTensor)
Ran 4 tests in 1.179s
FAILED (errors=3)