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

Err in 403_RNN_regressor.py #23

Closed
planewave opened this issue May 4, 2018 · 1 comment
Closed

Err in 403_RNN_regressor.py #23

planewave opened this issue May 4, 2018 · 1 comment

Comments

@planewave
Copy link

planewave commented May 4, 2018

loss = loss_func(prediction, y) # cross entropy loss

RuntimeError: input and target shapes do not match: input [10 x 1], target [1 x 10 x 1]

I think
y = Variable(torch.from_numpy(y_np[np.newaxis, :, np.newaxis]))
should be
y = Variable(torch.from_numpy(y_np[:, np.newaxis]))

could you also update your code to be compatible to version 0.4.0. I mean removing Variable

Thank you

@planewave planewave changed the title Err in Err in 403_RNN_regressor.py May 4, 2018
@MorvanZhou
Copy link
Owner

Thanks, I have updated the code to the new version.

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

2 participants