pythonpython-3.xtensorflowdeep-dream

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


I have taken the tensorflow deepdream example and have converted the Jupyter Notebook to a normal Python module.

When running the module from Eclipse / Python 3.6, I get the following traceback:

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'

There is a similar stackoverflow question where the user was able to workaround the problem by updating tensorboard to 1.9.0. I have the tensorflow and tensorboard 1.10.0 PyPi packages installed and even tried with version 1.9.0, but this doesn't resolve the problem.

There is another question that looks related to the issue, but no one has answered it.


Solution

  • Installing tensorflow 1.9.0 was a workaround for this issue.

    pip install tensorflow==1.9.0