tensorboardX使用中 AttributeError: 'function' object has no attribute 'graph'
最近在使用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'的更多相关文章
- flask_route错误:AttributeError: 'function' object has no attribute 'route'
问题: 路由完全正确,当只有一个名为home的函数处理这个路由时候,下一个路由处理函数,总是提示没有这个rotue属性 Traceback (most recent call last): File ...
- python调用对象属性出错:AttributeError: 'function' object has no attribute '_name_'
出错如下图所示: 原来是因为把__name__写成_name_, 下图为正确结果:
- AttributeError: 'function' object has no attribute 'as_view'
我的描述:当我启用jwt_required来进行token验证的时候,我提示错误; 解决方案: 修改前代码: 修改后代码: 多看书.多多了解.多看看世界...
- Keras AttributeError 'NoneType' object has no attribute '_inbound_nodes'
问题说明: 首先呢,报这个错误的代码是这行代码: model = Model(inputs=input, outputs=output) 报错: AttributeError 'NoneType' o ...
- AttributeError: 'NoneType' object has no attribute 'extend'
Python使用中可能遇到的小问题 AttributeError: 'NoneType' object has no attribute 'extend' 或者AttributeError: 'Non ...
- AttributeError: 'dict' object has no attribute 'status_code'
前端AJAX请求数据,提示错误:“AttributeError: 'dict' object has no attribute 'status_code'”. 原因:是提示返回对象dict没有“sta ...
- Python脚本报错AttributeError: ‘module’ object has no attribute’xxx’解决方法
最近在编写Python脚本过程中遇到一个问题比较奇怪:Python脚本完全正常没问题,但执行总报错"AttributeError: 'module' object has no attrib ...
- AttributeError: 'list' object has no attribute 'write_pdf'
我在可视化决策树,运行以下代码时报错:AttributeError: 'list' object has no attribute 'write_pdf' 我使用的是python3.4 from sk ...
- attributeError:'module' object has no attribute ** 解决办法
写了一个小脚本,执行的时候报错: Traceback (most recent call last): File "F:/test/qrcode.py", line 109, in ...
随机推荐
- HttpURLConnection 多线程下载
影响下载的速度 * 宽带的带宽 * 服务器的限制 * 服务器的资源固定,开启的线程越多抢占的资源就越多 import java.io.InputStream; import java.io.Rando ...
- 准确率(Precision)、召回率(Recall)以及综合评价指标(F1-Measure)
在信息检索和自然语言处理中经常会使用这些参数,下面简单介绍如下: 准确率与召回率(Precision & Recall) 我们先看下面这张图来加深对概念的理解,然后再具体分析.其中,用P代表P ...
- [CDH] Acquire data: Flume and Kafka
Flume 基本概念 一.是什么 Ref: http://flume.apache.org/ 数据源获取:Flume.Google Refine.Needlebase.ScraperWiki.Bloo ...
- Oracle动态执行脚本创建序号
-----------------------动态创建序列的脚本--------------------------- declare type num_list ) ); -- 老师表.学生表 xz ...
- React Native使用Redux总结
1>npm安装redux: "react-redux": "^5.0.5", "redux": "^3.7.1", ...
- maven 依赖原则
maven 依赖原则 ###间接依赖路径最短优先 a->b->c1.0 a->e->f->c1.1 ====>c1.0 申明顺序优先 <!-- test1 - ...
- python 学习记录1
存储 序号 分类 技术 用途 01 存储 Number 数字(不可变) String 字符串(不可变) List 列表 Tuple ...
- django 之(一) --- DjangoRestFormwork
接口概念 IOP:面向接口编程,不再关注具体的实现:只关注输入.输出. http://www.ruanyifeng.com/blog/2018/10/restful-api-best-practice ...
- OSI七层模型非专业简介
七层模型从下到上分别是:物理层.数据链路层.网络层.传输层.会话层.表示层.应用层. 1.第一层物理层:最简单理解,我们所看到的网线,就是物理层的.物理层是传输媒介,所以无线网络也算是物理层,在线路中 ...
- xss 学习(一)
存储型 .反射型.DOM 型这是最常见的三种分类: 存储型存储型XSS也叫持久型XSS,存储的意思就是Payload是有经过存储的,当一个页面存在存储型XSS的时候,XSS注入成功后,那么每次访问该页 ...