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

fix ValueError: invalid literal for int() with base 10 #20

Closed
gabrielraya opened this issue Aug 29, 2020 · 5 comments · Fixed by #21
Closed

fix ValueError: invalid literal for int() with base 10 #20

gabrielraya opened this issue Aug 29, 2020 · 5 comments · Fixed by #21
Labels
bug Something isn't working

Comments

@gabrielraya
Copy link

I got this error
ValueError

Apparently the fix is done by changing :

  • torch_version = [int(s) for s in torch.version.split(".")]

by

  • torch_version = [int(s) for s in torch.version.replace("+",".").split('.') if s.isdigit()]
@sdatkinson
Copy link
Collaborator

sdatkinson commented Aug 29, 2020

How is torch being installed?

Also, it seems that the real underlying issue is that we're using more information than we need to in order to figure out what potri is being called by PyTorch. If all we grabbed was the major and minor version eg

_torch_majorminor = [int(s) for s in torch.__version__.split(".")[:2]]
_potri = torch.cholesky_inverse if _torch_majorminor >= [1, 1] else torch.potri

then we wouldn't need to hack the CUDA bit on the end.

@nanxu2
Copy link

nanxu2 commented Oct 25, 2021

Hi Steven,
I've got the same issue.
My python version is 3.8 with torch 1.10.0.

@sdatkinson sdatkinson mentioned this issue Oct 30, 2021
@sdatkinson sdatkinson reopened this Oct 30, 2021
@sdatkinson
Copy link
Collaborator

Should be fixed in main now. @nanxu2 @gabrielraya go ahead and try it out and let me know if it fixes the issue (I can only guess the root cause is you're installing w/ e.g. pip install torch=1.10.0+cpu instead of the plain pip install torch).

I'll put this to PyPI in a new patch version if it fixes the issue.

@nanxu2
Copy link

nanxu2 commented Nov 1, 2021

@sdatkinson Hi Steven, It fixed the issue. The code can properly work on my desktop now. Thank you so much.

@sdatkinson
Copy link
Collaborator

Glad to hear it :)

@sdatkinson sdatkinson added the bug Something isn't working label Nov 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants