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