Closed jramapuram closed 7 years ago
Hi, I have fixed this bug, it's probably caused by the updating of the pytorch. Please try the latest version. :)
Tried this with a version built from master as well:
(conda3) ➜ Copy git:(master) python train.py
Using CPU.
Iteration 0/100000Traceback (most recent call last):
File "train.py", line 177, in <module>
output, _ = ncomputer(input_data)
File "/opt/anaconda/envs/conda/lib/python3.6/site-packages/torch/nn/modules/module.py", line 225, in __call__
result = self.forward(*input, **kwargs)
File "../../neucom/dnc.py", line 108, in forward
interface['erase_vector']
File "../../neucom/memory.py", line 383, 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 157, in cosine_distance
normalized_mem = torch.div(memory_matrix, memory_norm.expand_as(memory_matrix) + 1e-8)
File "/opt/anaconda/envs/conda3/lib/python3.6/site-packages/torch/autograd/variable.py", line 698, in expand_as
return Expand.apply(self, tensor.size())
File "/opt/anaconda/envs/conda3/lib/python3.6/site-packages/torch/autograd/_functions/tensor.py", line 113, in forward
result = i.expand(*new_size)
RuntimeError: The expanded size of the tensor (16) must match the existing size (15) at non-singleton dimension 2. at /home/jramapuram/projects/pytorch/torch/lib/TH/generic/THTensor.c:308
I can run it correclty. Please use the updated code.
pytorch git revision: ebdec9a837074a303fd5ffb6f319cd593955becc
pytorch-Neucom git revision: 2fe2a69583369225ad5e522a663b1c1f80a793c2
please use the latest update of pytorch-Neucom :6047382e6f934a70b92c9ba18c748b59c2a6275b
Yup, ty!