TypeError while Running Tensorflow Deep Dream Tutorial from Python: TypeError: __init__() got an unexpected keyword argument 'serialized_options'

TypeError while Running Tensorflow Deep Dream Tutorial from Python: TypeError: __init__() got an unexpected keyword argument 'serialized_options'

我参加了tensorflow deepdream example and have converted the Jupyter Notebook to a normal Python module.

当 运行 来自 Eclipse / Python 3.6 的模块时,我得到以下回溯:

Traceback (most recent call last):
  File "C:\git\tensorflow\tensorflow\examples\tutorials\deepdream\deepdream_python.py", line 43, in 
    import tensorflow as tf
  File "C:\Program Files\Python36\lib\site-packages\tensorflow\__init__.py", line 22, in 
    from tensorflow.python import pywrap_tensorflow  # pylint: disable=unused-import
  File "C:\Program Files\Python36\lib\site-packages\tensorflow\python\__init__.py", line 52, in 
    from tensorflow.core.framework.graph_pb2 import *
  File "C:\Program Files\Python36\lib\site-packages\tensorflow\core\framework\graph_pb2.py", line 15, in 
    from tensorflow.core.framework import node_def_pb2 as tensorflow_dot_core_dot_framework_dot_node__def__pb2
  File "C:\Program Files\Python36\lib\site-packages\tensorflow\core\framework\node_def_pb2.py", line 15, in 
    from tensorflow.core.framework import attr_value_pb2 as tensorflow_dot_core_dot_framework_dot_attr__value__pb2
  File "C:\Program Files\Python36\lib\site-packages\tensorflow\core\framework\attr_value_pb2.py", line 15, in 
    from tensorflow.core.framework import tensor_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__pb2
  File "C:\Program Files\Python36\lib\site-packages\tensorflow\core\framework\tensor_pb2.py", line 15, in 
    from tensorflow.core.framework import resource_handle_pb2 as tensorflow_dot_core_dot_framework_dot_resource__handle__pb2
  File "C:\Program Files\Python36\lib\site-packages\tensorflow\core\framework\resource_handle_pb2.py", line 22, in 
    serialized_pb=_b('\n/tensorflow/core/framework/resource_handle.proto\x12\ntensorflow\"r\n\x13ResourceHandleProto\x12\x0e\n\x06\x64\x65vice\x18\x01 \x01(\t\x12\x11\n\tcontainer\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\x11\n\thash_code\x18\x04 \x01(\x04\x12\x17\n\x0fmaybe_type_name\x18\x05 \x01(\tBn\n\x18org.tensorflow.frameworkB\x0eResourceHandleP\x01Z=github.com/tensorflow/tensorflow/tensorflow/go/core/framework\xf8\x01\x01\x62\x06proto3')
TypeError: __init__() got an unexpected keyword argument 'serialized_options'

有一个 用户可以通过将 tensorboard 更新到 1.9.0 来解决问题。我安装了 tensorflow 和 tensorboard 1.10.0 PyPi 包,甚至尝试使用 1.9.0 版,但这并没有解决问题。

another question 看起来与此问题相关,但没有人回答。

安装 tensorflow 1.9.0 是解决此问题的方法。

pip install tensorflow==1.9.0