最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

python - import torch throws TypeError: can't set attributes of built-inextension type 'torch._C.DisableTorchFun

programmeradmin2浏览0评论

I installed torch==1.13.0+cu116 and ran Python on the terminal. Then, I did import torch, but I got the following error:

>>> import torch
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/work/temp/venv/lib/python3.8/site-packages/torch/__init__.py", line 231, in <module>
    obj.__module__ = 'torch'
TypeError: can't set attributes of built-in/extension type 'torch._C.DisableTorchFunctionSubclass'

I'm using Python 3.8.10, nvcc release 11.6, and driver version 535.104.05

But the following command not show an error message

pip install torch==2.3.1 --index-url `

Why is this error occurring?

发布评论

评论列表(0)

  1. 暂无评论