因为torch版本的问题导致报错

  LooseVersion = distutils.version.LooseVersion
AttributeError: module 'distutils' has no attribute 'version'

检查了一下自己的totch版本

Python 3.7.16 (default, Jan 17 2023, 22:20:44) 
[GCC 11.2.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> torch.__version__
'1.9.0+cu102' 

torch的版本需要1.11及以上,通过如下代码解决:

pip install torch==1.11.0 

Logo

有“AI”的1024 = 2048,欢迎大家加入2048 AI社区

更多推荐