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

ImportError: cannot import name 'inf' from 'torch' #49

Open
pankaj-kvhld opened this issue Jul 8, 2023 · 1 comment
Open

ImportError: cannot import name 'inf' from 'torch' #49

pankaj-kvhld opened this issue Jul 8, 2023 · 1 comment

Comments

@pankaj-kvhld
Copy link

pankaj-kvhld commented Jul 8, 2023

I am trying it on Kaggle.

I ran pip install fastai-xla-extensions==0.0.6 to install library successfully.

But on running
import torch_xla

I get

ImportError                               Traceback (most recent call last)
Cell In[4], line 1
----> 1 import torch_xla

File /usr/local/lib/python3.8/site-packages/torch_xla/__init__.py:179
    177 import atexit
    178 import torch
--> 179 from ._patched_functions import _apply_patches
    180 from .version import __version__
    182 logger.info(
    183     'Letting libtpu.so load fail during _XLAC import. libtpu.so will be loaded '
    184     'from `libtpu` Python package when the ComputationClient is created.')

File /usr/local/lib/python3.8/site-packages/torch_xla/_patched_functions.py:4
      2 import torch
      3 import torch.nn as nn
----> 4 from torch import inf
      5 from typing import Iterable, Union, Optional
      7 _tensor_or_tensors = Union[torch.Tensor, Iterable[torch.Tensor]]

ImportError: cannot import name 'inf' from 'torch' (/usr/local/lib/python3.8/site-packages/torch/__init__.py)
@mphetens
Copy link

mphetens commented Dec 5, 2024

Markdown_1.0.1.zip

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