socialways icon indicating copy to clipboard operation
socialways copied to clipboard

runtime error when running toy example

Open luo-yuanfu opened this issue 6 years ago • 5 comments

Traceback (most recent call last): File "train.py", line 614, in test(128, write_to_file=wr_dir, just_one=True) File "train.py", line 533, in test pred_hat_4d = predict(obsv, noise, n_next) File "train.py", line 374, in predict new_v = decoder(encoder.lstm_h[0].view(bs, -1), weighted_features, noise).view(bs, 2) File "/home/yuanfu/workspace/socialways/env/lib/python3.5/site-packages/torch/nn/modules/module.py", line 491, in call result = self.forward(*input, **kwargs) File "train.py", line 290, in forward inp = torch.cat([h, s, z], dim=1) RuntimeError: invalid argument 0: Tensors must have same number of dimensions: got 2 and 1 at /pytorch/aten/src/THC/generic/THCTensorMath.cu:102

luo-yuanfu avatar Aug 03 '19 08:08 luo-yuanfu

I dont encounter such problem. Can you put a breakpoint at line 290 and tell me the size of tensors: h , s & z ? They should be 128x64, 128x64 and 128x32 respectively.

amiryanj avatar Aug 08 '19 10:08 amiryanj

Traceback (most recent call last): File "train.py", line 614, in test(128, write_to_file=wr_dir, just_one=True) File "train.py", line 533, in test pred_hat_4d = predict(obsv, noise, n_next) File "train.py", line 374, in predict new_v = decoder(encoder.lstm_h[0].view(bs, -1), weighted_features, noise).view(bs, 2) File "/home/yuanfu/workspace/socialways/env/lib/python3.5/site-packages/torch/nn/modules/module.py", line 491, in call result = self.forward(*input, **kwargs) File "train.py", line 290, in forward inp = torch.cat([h, s, z], dim=1) RuntimeError: invalid argument 0: Tensors must have same number of dimensions: got 2 and 1 at /pytorch/aten/src/THC/generic/THCTensorMath.cu:102

Excuse me,I encounter the same problem when I use the seq_hotel dataset. Have you solved this problem, please?

Dear-zhangliyuan avatar Oct 04 '19 09:10 Dear-zhangliyuan

@Dear-zhangliyuan Hi Liyuan, thanks for reporting this issue, I found out this bug was due to some special case in the dataset, anyway I fixed it, and now you should be able to train on hotel dataset. https://github.com/amiryanj/socialways/commit/80c0209af7ba3c977d4e463db4d24aeb07874e9c

amiryanj avatar Oct 08 '19 09:10 amiryanj

@Dear-zhangliyuan Hi Liyuan, thanks for reporting this issue, I found out this bug was due to some special case in the dataset, anyway I fixed it, and now you should be able to train on hotel dataset. 80c0209

Yes, it is really work now. You are so great! ! Thanks very much!!

Dear-zhangliyuan avatar Oct 08 '19 11:10 Dear-zhangliyuan

hello javad, I used the hotel dataset to train yesterday, it can work. But I run the visualize.py today, I found it can't work normally. And the zara01 dataset can't also visualize. Besides,When I train use the zara02, it has a huge loss. I hope that you can help me debug it if you are convenient. Thanks!

Dear-zhangliyuan avatar Oct 09 '19 01:10 Dear-zhangliyuan