Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

runtime error when running toy example #4

Open
luo-yuanfu opened this issue Aug 3, 2019 · 5 comments
Open

runtime error when running toy example #4

luo-yuanfu opened this issue Aug 3, 2019 · 5 comments

Comments

@luo-yuanfu
Copy link

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

@amiryanj
Copy link
Collaborator

amiryanj commented Aug 8, 2019

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.

@Dear-zhangliyuan
Copy link

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?

@amiryanj
Copy link
Collaborator

amiryanj commented Oct 8, 2019

@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

@Dear-zhangliyuan
Copy link

@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
Copy link

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants