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 ...
随机推荐
- Activity节点
1.android:allowTaskReparenting Android:allowTaskReparenting是一个任务调整属性,它表明当这个任务重新被送到前台时,该应用程序所定义的Activ ...
- 010-数据结构-树形结构-B树[B-树]
一.概述 B 树就是常说的“B 减树(B- 树)”,又名平衡多路(即不止两个子树)查找树. 在计算机科学中,B树(英语:B-tree)是一种自平衡的树,能够保持数据有序.这种数据结构能够让查找数据.顺 ...
- nginx.conf 配置 (反向代理,负载均衡,fastdfs model)
#user nobody;worker_processes 1; #error_log logs/error.log;#error_log logs/error.log notice;#error_l ...
- 你应该知道的 MySQL 的锁
背景 数据库的锁是在多线程高并发的情况下用来保证数据稳定性和一致性的一种机制.MySQL 根据底层存储引擎的不同,锁的支持粒度和实现机制也不同.MyISAM 只支持表锁,InnoDB 支持行锁和表锁. ...
- 安装mysql报Requires: libc.so.6(GLIBC_2.17)(64bit)
Error: Package: mysql-community-server-5.6.40-2.el7.x86_64 (mysql56-community) Requires: libc.so.6(G ...
- DevOps - 构建本地开发环境
1 - 构建个人本地开发环境 在个人计算机中搭建一个精简版的.与生产环境基本一致的本地开发环境,既不会占用团队公共环境的资源,也可以缩短等待时间,从整体上提高效率. 本地开发环境的适用场景: 从应用程 ...
- maria 忘记密码
1.找到mariadb配置文件命令:find / -name my.cnf 备注:一般是在 /etc/my.cnf 2.修改配置文件 在MariaDB配置文件/etc/my.cnf的[mysqld]配 ...
- 2.React 生命周期函数
什么是生命周期函数:在某一时刻组件会自动调用执行的函数. import React,{ Component,Fragment } from 'react' class Note extends Com ...
- Nmap使用手册参数详细说明
nmap –iflist : 查看本地主机的接口信息和路由信息 -A :选项用于使用进攻性方式扫描 -T4: 指定扫描过程使用的时序,总有6个级别(0-5),级别越高,扫描速度越快,但也容易被防火 ...
- mysq的慢查询日志
MySQL 慢查询日志是排查问题 SQL 语句,以及检查当前 MySQL 性能的一个重要功能. 查看是否开启慢查询功能: mysql> show variables like 'slow_que ...