Tensorflow protobuf版本报错问题解决(AttributeError: 'module' object has no attribute 'Default')
来源:互联网 发布:mysql sys_refcursor 编辑:程序博客网 时间:2024/05/20 09:46
无意中发现TF跑不了,报的错误是:
AttributeError: 'module' object has no attribute 'Default'
如下:
>>> import tensorflow as tfTraceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/schidester/usr/tf/local/lib/python2.7/site-packages/tensorflow/__init__.py", line 24, in <module> from tensorflow.python import * File "/home/schidester/usr/tf/local/lib/python2.7/site-packages/tensorflow/python/__init__.py", line 75, in <module> from tensorflow.core.framework.graph_pb2 import * File "/home/schidester/usr/tf/local/lib/python2.7/site-packages/tensorflow/core/framework/graph_pb2.py", line 9, in <module> from google.protobuf import symbol_database as _symbol_database File "/usr/local/lib/python2.7/dist-packages/google/protobuf/symbol_database.py", line 165, in <module> _DEFAULT = SymbolDatabase(pool=descriptor_pool.Default())AttributeError: 'module' object has no attribute 'Default'
关于这个问题,网上有各种解决方案,但是始终不对。
如pip install --upgrade protobuf等这种办法,发现这样操作之后仍旧是无效。
后来进到/usr/loca/lib/python3.6/site-packages/中才发现,里面的protobuf版本有3.2,3.4等多个版本。没有办法,只好去看https://github.com/tensorflow/tensorflow/releases中关于protobuf的相关说明,才发现里面需要用到的tf对应的protobuf版本是3.0.0b2,https://pypi.python.org/pypi/protobuf/3.0.0b2,从这个网站上进行下载WHL文件,再进行安装,果然顺利成功。解决该问题。
阅读全文
1 0
- Tensorflow protobuf版本报错问题解决(AttributeError: 'module' object has no attribute 'Default')
- Tensorflow报错:AttributeError: 'module' object has no attribute 'summary'
- 【Tensorflow】报错:AttributeError: 'module' object has no attribute 'scalar_summary'
- Tensorflow报错:AttributeError: 'module' object has no attribute 'scalar_summary'
- tensorflow报错:AttributeError: 'module' object has no attribute 'get_or_create_global_step'
- import module报错AttributeError: 'module' object has no attribute
- python3 报错: AttributeError: 'module' object has no attribute 'urlopen'
- 报错AttributeError: 'module' object has no attribute 'HTTPSConnection'
- 报错 AttributeError: 'module' object has no attribute 'bool_'
- pandas报错AttributeError: 'module' object has no attribute 'plotting'
- tensorflow AttributeError: 'module' object has no attribute 'cpu_count'
- 【TensorFlow问题】AttributeError:'module' object has no attribute 'mul'
- tensorflow AttributeError: 'module' object has no attribute 'cpu_count'
- tensorflow :AttributeError: 'module' object has no attribute 'computation'
- 【TensorFlow问题】AttributeError:'module' object has no attribute 'mul'
- AttributeError: 'module' object has no attribute 'face' 问题解决 opencv+python
- AttributeError: ‘module’ object has no attribute’xxx 问题解决
- 使用旧版本tensorflow出现了negative等报错的问题,AttributeError: 'module' object has no attribute 'xxx'"
- 15. 3Sum && 16 sum closet && 18 4sum
- Ubuntu14.04 python 升级为3.5 && virtualenv安装
- 深度系统v15.4正式发布,惊艳眼球
- Kafka主要参数详解
- 3.2 使用 URL 类请求和提交数据详解
- Tensorflow protobuf版本报错问题解决(AttributeError: 'module' object has no attribute 'Default')
- 老是记不住一些知识点,索性开始写博客记录下,以便自己或他人阅读
- 高速PCB 阻抗计算
- “米录”讨论总结(三)
- Visiting Peking University(水)
- Codevs 2597 团伙
- 3.3 基于 Socket 协议的网络通信详解
- 《C++Primer》读书笔记汇总
- 使用LinkedList模仿队列