最近在使用tensorboardX可视化网络结构,因为tensorboardX并非pytorch原生的可视化工具,所以版本之间并不兼容

在使用的过程中会遇到,AttributeError: 'function' object has no attribute 'graph',大概是版本之间不兼容

完整错误如下

Traceback (most recent call last):
File "source_hourglassnet.py", line , in <module>
writer.add_graph(model, (input_data, ))
File "/home/yongjie/anaconda2/envs/danfeng/lib/python3.6/site-packages/tensorboardX/writer.py", line , in add_graph
self._get_file_writer().add_graph(graph(model, input_to_model, verbose, **kwargs))
File "/home/yongjie/anaconda2/envs/danfeng/lib/python3.6/site-packages/tensorboardX/pytorch_graph.py", line , in graph
graph = trace.graph
AttributeError: 'function' object has no attribute 'graph'

搜到了一个解决方案说的是tensorboardX1.8对于低版本的pytorch支持不是很好

conda list发现 tensorboardX确实是1.8版本的,pip uninstall tensorboardX之后再

重新安装pip install tensorboardX=1.4

安装完之后就可以正常使用了

没毛病

但是这里有另外一个问题就是,我用pip search tensorboardX

的时候并没有发现1.4版本的,但是我用pip install tensorboardX=1.4的时候是可以使用的,不知道为啥

tensorboardX使用中 AttributeError: 'function' object has no attribute 'graph'的更多相关文章

  1. flask_route错误:AttributeError: 'function' object has no attribute 'route'

    问题: 路由完全正确,当只有一个名为home的函数处理这个路由时候,下一个路由处理函数,总是提示没有这个rotue属性 Traceback (most recent call last): File ...

  2. python调用对象属性出错:AttributeError: 'function' object has no attribute '_name_'

    出错如下图所示: 原来是因为把__name__写成_name_, 下图为正确结果:

  3. AttributeError: 'function' object has no attribute 'as_view'

    我的描述:当我启用jwt_required来进行token验证的时候,我提示错误; 解决方案: 修改前代码: 修改后代码: 多看书.多多了解.多看看世界...

  4. Keras AttributeError 'NoneType' object has no attribute '_inbound_nodes'

    问题说明: 首先呢,报这个错误的代码是这行代码: model = Model(inputs=input, outputs=output) 报错: AttributeError 'NoneType' o ...

  5. AttributeError: 'NoneType' object has no attribute 'extend'

    Python使用中可能遇到的小问题 AttributeError: 'NoneType' object has no attribute 'extend' 或者AttributeError: 'Non ...

  6. AttributeError: 'dict' object has no attribute 'status_code'

    前端AJAX请求数据,提示错误:“AttributeError: 'dict' object has no attribute 'status_code'”. 原因:是提示返回对象dict没有“sta ...

  7. Python脚本报错AttributeError: ‘module’ object has no attribute’xxx’解决方法

    最近在编写Python脚本过程中遇到一个问题比较奇怪:Python脚本完全正常没问题,但执行总报错"AttributeError: 'module' object has no attrib ...

  8. AttributeError: 'list' object has no attribute 'write_pdf'

    我在可视化决策树,运行以下代码时报错:AttributeError: 'list' object has no attribute 'write_pdf' 我使用的是python3.4 from sk ...

  9. attributeError:'module' object has no attribute ** 解决办法

    写了一个小脚本,执行的时候报错: Traceback (most recent call last): File "F:/test/qrcode.py", line 109, in ...

随机推荐

  1. VLAN和VXLAN的区别

    VLAN ·概况 VLAN (Virtual Local Area Network)意为虚拟局域网,是在交换机实现过程中涉及到的概念,由802.1Q标准所定义.由于交换机是工作在链路层的网络设备,连接 ...

  2. delphi 中Adoquery ,在打开时能否让记录指针不移动? [问题点数:40分,结帖人microd]

    delphi 中Adoquery ,在打开时能否让记录指针不移动?由于数据集Adoquery 时,它的针指称动会废时,能否在打开完成之前不让记录指针不移动.打开完毕之后再回复移动? 这样用:self. ...

  3. JAVA中注解的实现原理

    注解的本质 「java.lang.annotation.Annotation」接口中有这么一句话,用来描述『注解』. The common interface extended by all anno ...

  4. unity2d教程

    https://segmentfault.com/a/1190000003965359

  5. lumen返回网站base url

    可以使用全局帮助函数url() echo url(); //输出http://test.domain.com

  6. Python 网络通信协议(互联网协议)

    一. 操作系统基础 操作系统(Operatin System,简称OS)是管理和控制计算机硬件与软件资源的计算机程序,是直接运行在"裸机"上的最基本的系统软件,任何其他软件都必须在 ...

  7. nexus私服库被误删如何恢复

    恢复步骤: 1,登录nexus服务器,找到nexus安装目录(默认/usr/local/下): 2,找到sonatype-work/nexus/trash 下找到你删除的库: 3,copy到指定的so ...

  8. 【ABAP系列】SAP MAC GUI750安装过程

    公众号:SAP Technical 本文作者:matinal 原文出处:http://www.cnblogs.com/SAPmatinal/ 原文链接:[ABAP系列]SAP MAC GUI750安装 ...

  9. lua学习笔记2--table

    table是lua中的一种"数据/代码结构",可以用俩创建不同的"数据类型"lua语言中的数组其实就是table类型 array = {, , , , } pr ...

  10. 配置nova-compute在不同的hypervisors上使用不同的存储后端

    说明:主参考:https://www.sunmite.com/openstack/use-local-storage-for-different-hypervisors.html 在控制节点上执行 1 ...