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 //需要比你之前的低
文章来源:https://www.toymoban.com/news/detail-667521.html
文章来源地址https://www.toymoban.com/news/detail-667521.html
到了这里,关于python, torch. 遇到AttributeError: module ‘distutils‘ has no attribute ‘version‘ 报错。的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!