python, torch. 遇到AttributeError: module ‘distutils‘ has no attribute ‘version‘ 报错。

这篇具有很好参考价值的文章主要介绍了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 //需要比你之前的低 

使用from torch.utils.tensorboard import summarywriter发生错误attributeerror:,linux,ubuntu,运维,python,pytorch

 文章来源地址https://www.toymoban.com/news/detail-667521.html

到了这里,关于python, torch. 遇到AttributeError: module ‘distutils‘ has no attribute ‘version‘ 报错。的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包赞助服务器费用

相关文章

  • AttributeError: module ‘torch.nn‘ has no attribute ‘module‘

    AttributeError: module ‘torch.nn‘ has no attribute ‘module‘

    如上,调用时报错: init () takes 1 positional argument but 2 were given 纠错发现是少打了下划线 init前后有两个_,

    2024年02月16日
    浏览(17)
  • python遇到AttributeError: module ‘XXX‘ has no attribute ‘XXX‘的错误,解决办法

    错误原因: 主要的原因看可能有3个: 1、检查一下有没有拼错函数,有时候写的快了真的有可能手误; 2、如果没拼错那就检测一下该模块的函数是否是更新了,因为python的第三方库是时常会更新的,有时候函数名会有轻微的变动这也很正常,解决方法就是查看一下对应版本

    2024年04月12日
    浏览(13)
  • AttributeError: module ‘torch‘ has no attribute ‘concat‘

    AttributeError: module ‘torch‘ has no attribute ‘concat‘

        如图上所示报错地方 在跑算法代码的时候,发现报错,但是这个错误在网上没有找到,我推测是pytorch改版问题,于是查看torch版本改动,发现torch.concat改版后该写为torch.cat。不过或许我写的也不够准确,除此之外还看到了有人问torch.concat和torch.cat的区别。     不过出现

    2024年02月16日
    浏览(16)
  • AttributeError: module ‘torch‘ has no attribute ‘cuda‘

    AttributeError: module ‘torch‘ has no attribute ‘cuda‘

    系统环境是Linux ,显卡:nvida-T4。 看了下原因为没有装pytorch。 (印象中是装了的不知道什么时候这台服务器没有了。。) 解决方案:到pytorch官网上找到对应的cuda版本的pytorch安装即可 Previous PyTorch Versions | PyTorch 比如我的是cuda 10.2(使用nvcc -V命令查看) 那么就是使用以下命

    2024年02月12日
    浏览(15)
  • 完美解决 AttributeError: module ‘torch.utils‘ has no attribute ‘data‘

    完美解决 AttributeError: module ‘torch.utils’ has no attribute ‘data’ 下滑查看解决方法 AttributeError: module ‘torch.utils‘ has no attribute ‘data‘ 这个错误通常是由于使用了过时的torch版本导致的。在旧的torch版本中,torch.utils.data模块是存在的,但在新版的torch中已经被移除,因此会出现

    2024年02月07日
    浏览(16)
  • AttributeError: module ‘torch.nn‘ has no attribute ‘SiLU‘问题的解决办法

    AttributeError: module ‘torch.nn‘ has no attribute ‘SiLU‘问题的解决办法

    AttributeError: module \\\'torch.nn\\\' has no attribute \\\'SiLU\\\'        这个问题的原因是这个版本的torch中的torch.nn函数表里面没有这个SiLU函数,需要更高版本的torch,在官方的文档中我们就可以查看这个版本里有没有包含这个模块。 官方文档1.1.0    红框选择 torch 版本,我的版本是1.1.0,搜

    2024年02月13日
    浏览(16)
  • AttributeError: module ‘torch.distributed‘ has no attribute ‘_all_gather_base‘

    AttributeError: module ‘torch.distributed‘ has no attribute ‘_all_gather_base‘

    安装完apex后,调用的是时候出现如下错误: 注释下面的代码: 路径: apex/contrib/optimizers/distributed_fused_lamb.py apex/transformer/tensor_parallel/layers.py apex/transformer/tensor_parallel/utils.py apex/transformer/tensor_parallel/mappings.py 接下来添加环境变量。 执行命令 vi ~/.bashrc 打开文件,然后,按 i

    2024年02月12日
    浏览(14)
  • PyTorch AttributeError: module ‘torch._C‘ has no attribute ‘_cuda_setDevice‘

    这个问题说简单也很简单,大概率是你的pytorch安装了cpu版本...但现在默认安装下来就是cpu版本,可以在python中输入下面两行测试以下是不是不可用,如果显示False,那么就是不可用。 然后可以conda list看一下pytorch的版本,如果是cpu的版本,那么可以参考另一个写的很详细的博

    2024年02月13日
    浏览(10)
  • 解决AttributeError: module ‘tensorflow.python.keras‘ has no attribute ‘Model‘

    目录 解决AttributeError: module \\\'tensorflow.python.keras\\\' has no attribute \\\'Model\\\' 引言 错误原因 解决方案 1. 升级TensorFlow版本 2. 正确导入模块 3. 检查其他依赖项 4. 重新安装TensorFlow 结论 实际应用场景: 引言 在使用TensorFlow的过程中,您可能会遇到各种错误。其中之一是​ ​AttributeError:

    2024年02月05日
    浏览(18)
  • python numpy 错误:AttributeError: module ‘numpy‘ has no attribute ‘bool‘

    python numpy 错误:AttributeError: module ‘numpy‘ has no attribute ‘bool‘

    跑代码(pyCUDA,pyTensorRT相关)的时候 numpy 报错 ”AttributeError: module \\\'numpy\\\' has no attribute \\\'bool\\\'“ 把 numpy 从 1.22.x 升级到 1.23.1 灵感来自于下面的回答 https://stackoverflow.com/questions/74893742/how-to-solve-attributeerror-module-numpy-has-no-attribute-bool

    2024年02月12日
    浏览(12)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包