lit-llama icon indicating copy to clipboard operation
lit-llama copied to clipboard

No module named 'torch.utils._device'

Open nikuson opened this issue 2 years ago • 5 comments

No module named 'torch.utils._device'

nikuson avatar Apr 13 '23 14:04 nikuson

Can you share the complete error stacktrace?

Are you using torch==2.0?

carmocca avatar Apr 13 '23 18:04 carmocca

yes i am using torch 2.0

Can you share the complete error stacktrace?

Are you using torch==2.0?

yes i am using torch 2.0

nikuson avatar Apr 13 '23 22:04 nikuson

Can you share the complete error stacktrace?

Are you using torch==2.0?

Traceback (most recent call last): File "D:\Python\Llama\llama\generate.py", line 10, in
from lit_llama.utils import EmptyInitOnDevice File "D:\Python\Llama\llama\lit_llama\utils.py", line 8, in import torch.utils._device ModuleNotFoundError: No module named 'torch.utils._device'

nikuson avatar Apr 16 '23 15:04 nikuson

Can you share the output of

pip list | grep torch and python -c 'import torch; print(torch.__version__)'?

You might have non-release version that doesn't include that file. Reinstalling torch by following the instructions at www.pytorch.org/get-started/locally should help

carmocca avatar Apr 16 '23 18:04 carmocca

Traceback (most recent call last): File "sketch3.py", line 1, in import torch File "/home/stud2201/.local/lib/python3.8/site-packages/torch/init.py", line 21, in from ._utils import _import_dotted_name ModuleNotFoundError: No module named 'torch._utils'

Ramakrishna176420 avatar Dec 09 '23 02:12 Ramakrishna176420