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: a leaf Variable that requires grad has been used in an in-place operation. #11

Closed
CheriseZhu opened this issue Jul 3, 2019 · 4 comments

Comments

@CheriseZhu
Copy link

I'm sure that all the packedge and codes are up to date. But it cannot run using default settings, and when setting decision_type="hyp", the hyrnn.MobiusDist2Hyperplane module still has a problem as follows.

File "....../hyrnn/nets.py", line 180, in init
self.tangent = geoopt.ManifoldParameter(tangent, manifold=sphere).proj_()
File "...../geoopt/tensor.py", line 40, in proj_
return copy_or_set_(self, self.manifold.projx(self))
File "..../geoopt/utils.py", line 24, in copy_or_set_
return dest.set_(source)
RuntimeError: a leaf Variable that requires grad has been used in an in-place operation.

@rrkarim
Copy link
Collaborator

rrkarim commented Jul 4, 2019

Can you please install the requirements pip install -r requirements.txt and then check again. I've made some changes there.

@ferrine
Copy link
Owner

ferrine commented Jul 4, 2019

It is the projection on manifold that causes error, we changed that to have consistent behavior to pytorch. Inplace methods on leaf vars now require no_grad context

@ferrine ferrine mentioned this issue Jul 4, 2019
@ferrine
Copy link
Owner

ferrine commented Jul 4, 2019

This now should be fixed, could you please check?

@CheriseZhu
Copy link
Author

After updating the hyrnn.MobiusDist2Hyperplane module, this error has been fixed.

@ferrine ferrine closed this as completed Jul 5, 2019
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