解决Python中torch模块报错:AttributeError: module ‘distutils’ has no attribute ‘version’

1.已经安装了pip install tensorboard 出现报错

  在使用torch.utils.tensorboard时,出现错误:

  出错语句from torch.utils.tensorboard import SummaryWriter

  AttributeError: module 'distutils' has no attribute 'version'

2.问题原因 当前tensorboard的版本和你安装的pytorch版本不匹配,tensorboard版本太      高,pytorch太低。

3解决办法,

  一般来说具体哪个地方attribute 不匹配我们就降低那个部分的版本。

  此处解决方法为

pip uninstall setuptools
pip install setuptools==59.5.0 //需要比你之前的低 

 

物联沃分享整理
物联沃-IOTWORD物联网 » 解决Python中torch模块报错:AttributeError: module ‘distutils’ has no attribute ‘version’

发表评论