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 ...
随机推荐
- cefsharp wpf
github 安装 PM> Install-Package CefSharp.Wpf 解决方案->属性->配置属性->活动解决方案平台-新建-x64 在需要使用的窗体上引用xm ...
- python之scrapy模块下载中间件
知识点 使用方法: 编写一个Downloader Middlewares和我们编写一个pipeline一样,定义一个类,然后在setting中开启 Downloader Middlewares默认的方 ...
- Ubuntu16.04中VirtualBox中安装FreeBSD
获取镜像 FreeBSD官网:https://www.freebsd.org,打开后即可看到“Download Freebsd”的按钮,点击进去 进入版本选择的页面.可以看到当前RELEASR版本,旧 ...
- jsp细节------<base>
1:jsp一般都有这个<base href="<%=basePath%>">,它的作用一般用不到,但在使用java框架用注解时会用. 如下代码(xxx.js ...
- Linux任务后台运行的方法
linux在后台运行程序当我们在终端或控制台工作时,可能不希望由于运行一个作业而占住了屏幕,因为可能还有更重要的事情要做,比如阅读电子邮件.对于密集访问磁盘的进程,我们更希望它能够在每天的非负荷高峰时 ...
- MySQL时间相关操作
本文主要介绍MySQL使用过程中有关时间处理的相关操作: MySQL时间更新(加上或减去一段时间) MySQL毫秒数和日期之间的转换 一.MySQL时间更新(加上或减去一段时间) 1.1 MySQL时 ...
- 购物车实现 <Block实现回调>
效果图如下: 具体代码实现如下: Model: #import <Foundation/Foundation.h> @interface ShopCarModel : NSObject @ ...
- php代码判断用户访问的当前协议是否为https
public function isHttps() { if ( ! empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) ...
- php支持多个地址跨域访问
//跨域访问的时候才会存在此字段 $origin = isset($_SERVER['HTTP_ORIGIN']) ? $_SERVER['HTTP_ORIGIN'] : ''; $allow_ori ...
- 删除ELK的索引
终于找到一个工具,curator,可以搜索相关信息. 记录一下: 1,查询索引: curator_cli --host 10.2.16.191 --port 9200 show_indices - ...