Anaconda Tensorflow
我用以下去做物件侦测
https://reurl.cc/62aNgk
Tensorflow-gpu改成1.13.1
from tensorflow.python.client import device_lib
print(device_lib.list_local_devices())
是可以执行的
可是执行 conda install -c anaconda protobuf 之后,
from tensorflow.python.client import device_lib
会出现如下错误,查询后是protobuf的问题。
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File
"C:\Users\USER\anaconda3\envs\tensorflow-gpu\lib\site-packages\tensorflow\__init__.py",
line 24, in <module>
from tensorflow.python import pywrap_tensorflow # pylint:
disable=unused-import
File
"C:\Users\USER\anaconda3\envs\tensorflow-gpu\lib\site-packages\tensorflow\python\__init__.py",
line 52, in <module>
from tensorflow.core.framework.graph_pb2 import *
File
"C:\Users\USER\anaconda3\envs\tensorflow-gpu\lib\site-packages\tensorflow\core\framework\graph_pb2.py",
line 9, in <module>
from google.protobuf import symbol_database as _symbol_database
File
"C:\Users\USER\anaconda3\envs\tensorflow-gpu\lib\site-packages\google\protobuf\symbol_database.py",
line 184, in <module>
_DEFAULT = SymbolDatabase(pool=descriptor_pool.Default())
AttributeError: module 'google.protobuf.descriptor_pool' has no attribute
'Default'
https://blog.csdn.net/ccbrid/article/details/103425627
查询后可能是protobuf的问题,那么在安装时需要怎么去修改?
※ 编辑: chuinzong (59.120.90.184 台湾), 03/23/2020 15:18:59