Skip to content

Fixed unsqueeze error#3

Open
bgreenawald wants to merge 1 commit intodxyang:masterfrom
bgreenawald:master
Open

Fixed unsqueeze error#3
bgreenawald wants to merge 1 commit intodxyang:masterfrom
bgreenawald:master

Conversation

@bgreenawald
Copy link

A fix to the issue: #2.
Using a newer version of Pytorch led to the following error:
RuntimeError: invalid argument 3: Index tensor must have same dimensions as input tensor at /pytorch/torch/lib/THC/generic/THCTensorScatterGather.cu:199

This checks the version of Pytorch being used. If '0.2.0' is used, nothing changes. If a newer version is used, line 229 in "learn.py" is changed from
q_s_a.backward(clipped_error.data.unsqueeze(1))
to
q_s_a.backward(clipped_error.data)
which solves the error.

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

Successfully merging this pull request may close these issues.

1 participant