pytorch-NeuCom icon indicating copy to clipboard operation
pytorch-NeuCom copied to clipboard

TypeError: norm received an invalid combination of arguments - got (int, bool), but expected one of:

Open SeekPoint opened this issue 7 years ago • 2 comments

(VENVpytorch2) mldl@mldlUB1604:~/ub16_prj/pytorch-NeuCom/tasks/Copy$ python train.py Using CUDA. Iteration 0/100000Traceback (most recent call last): File "train.py", line 177, in output, _ = ncomputer(input_data) File "/home/mldl/ub16_prj/VENV_host/VENV_pytorch2/VENVpytorch2/local/lib/python2.7/site-packages/torch/nn/modules/module.py", line 206, in call result = self.forward(*input, **kwargs) File "../../neucom/dnc.py", line 108, in forward interface['erase_vector'] File "../../neucom/memory.py", line 384, in write lookup_weight = self.get_content_address(memory_matrix, key, strength) File "../../neucom/memory.py", line 78, in get_content_address cos_dist = cosine_distance(memory_matrix, query_keys) File "../../neucom/utils.py", line 154, in cosine_distance memory_norm = torch.norm(memory_matrix, 2, dim=True) File "/home/mldl/ub16_prj/VENV_host/VENV_pytorch2/VENVpytorch2/local/lib/python2.7/site-packages/torch/autograd/variable.py", line 596, in norm return Norm(p, dim)(self) File "/home/mldl/ub16_prj/VENV_host/VENV_pytorch2/VENVpytorch2/local/lib/python2.7/site-packages/torch/autograd/_functions/reduce.py", line 192, in forward output = input.norm(self.norm_type, self.dim) TypeError: norm received an invalid combination of arguments - got (int, bool), but expected one of:

  • no arguments
  • (float p)
  • (float p, int dim) didn't match because some of the arguments have invalid types: (int, bool)

(VENVpytorch2) mldl@mldlUB1604:~/ub16_prj/pytorch-NeuCom/tasks/Copy$

SeekPoint avatar Jul 31 '17 08:07 SeekPoint

Please use the master branch of pytorch.

ypxie avatar Jul 31 '17 13:07 ypxie

@ypxie sure, I just retry with the pytorch builting from source code

still the same error

SeekPoint avatar Aug 01 '17 12:08 SeekPoint