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

RuntimeError #6

Closed
marooncn opened this issue Apr 20, 2018 · 2 comments
Closed

RuntimeError #6

marooncn opened this issue Apr 20, 2018 · 2 comments

Comments

@marooncn
Copy link

Hi, when I run
python3 trainer.py
There comes an error:

Traceback (most recent call last):
File "trainer.py", line 203, in
R, probs, actions, actions_idxs = model(bat)
File "/home/maroon/.local/lib/python3.5/site-packages/torch/nn/modules/module.py", line 357, in call
result = self.forward(*input, **kwargs)
File "/home/maroon/PycharmProjects/neural-combinatorial-rl-pytorch/neural_combinatorial_rl.py", line 539, in forward
R = self.objective_fn(actions, self.use_cuda)
File "/home/maroon/PycharmProjects/neural-combinatorial-rl-pytorch/sorting_task.py", line 49, in reward
current += res.float()
RuntimeError: invalid argument 1: the number of sizes provided must be greater or equal to the number of dimensions in the tensor at /pytorch/torch/lib/TH/generic/THTensor.c:299

How can I solve it? Thank you.

@maltedeckers
Copy link

Hi, I had the same issue, using PyTorch 0.4.0.
Maybe my solution in my fork (https://github.com/mteser/neural-combinatorial-rl-pytorch) works for you, too?

@pemami4911
Copy link
Owner

This is an issue due to using PyTorch 0.3 (previously, this code was only compatible with PyTorch 0.2). The master branch should now work with both 0.2 and 0.3.

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