Python TypeError:__init __()获得了意外的关键字参数'serialized_options' [英] Python TypeError: __init__() got an unexpected keyword argument 'serialized_options'

查看:128
本文介绍了Python TypeError:__init __()获得了意外的关键字参数'serialized_options'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在这里遇到了一个困扰我几天的问题:(

I have a problem here which annoyed me for several days:(

我是python和tensorflow的新手.

I am new to python and tensorflow.

当我练习tensorflow并尝试使用tensorboard时,我遇到了这个问题.

When I was practicing tensorflow and tried to use tensorboard, I met this question.

我用PyCharm编写了python,而且我的python版本是3.6.

I wrote python in PyCharm and also my python version is 3.6.

我的代码的一部分是:

init = tf.global_variables_initializer()
sess = tf.Session()
writer = tf.summary.FileWriter("logs/",sess.graph) 
sess.run(init)

然后,我去终端并输入命令:

then, I go to terminal and write the command:

cd /Users/Claire/Library/Preferences/PyCharmCE2018.2/scratches

然后,我看到一个名为logs"的目录,其中包含events.out.tfevents.1533570728.H-MacBook-Air.local".

then, I see a directory called "logs" which has "events.out.tfevents.1533570728.H-MacBook-Air.local" in it.

所以,我在下面写一条命令

So, i write a command under

/Users/Claire/Library/Preferences/PyCharmCE2018.2/scratches

/Users/Claire/Library/Preferences/PyCharmCE2018.2/scratches

tensorboard --logdir='logs/'

然后,我得到了这个错误:

then, I got this error:

Traceback (most recent call last):
  File "/usr/local/bin/tensorboard", line 7, in <module>
    from tensorboard.main import run_main
  File "/usr/local/lib/python3.6/site-packages/tensorboard/main.py", line 40, in <module>
    from tensorboard import default
  File "/usr/local/lib/python3.6/site-packages/tensorboard/default.py", line 37, in <module>
    from tensorboard.plugins.audio import audio_plugin
  File "/usr/local/lib/python3.6/site-packages/tensorboard/plugins/audio/audio_plugin.py", line 30, in <module>
    from tensorboard.plugins.audio import metadata
  File "/usr/local/lib/python3.6/site-packages/tensorboard/plugins/audio/metadata.py", line 22, in <module>
    from tensorboard.plugins.audio import plugin_data_pb2
  File "/usr/local/lib/python3.6/site-packages/tensorboard/plugins/audio/plugin_data_pb2.py", line 22, in <module>
serialized_pb=_b('\n+tensorboard/plugins/audio/plugin_data.proto\x12\x0btensorboard\"}\n\x0f\x41udioPluginData\x12\x0f\n\x07version\x18\x01 \x01(\x05\x12\x37\n\x08\x65ncoding\x18\x02 \x01(\x0e\x32%.tensorboard.AudioPluginData.Encoding\" \n\x08\x45ncoding\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x07\n\x03WAV\x10\x0b\x62\x06proto3')                   
TypeError: __init__() got an unexpected keyword argument 'serialized_options'

有人可以帮助我吗?谢谢.

Can anyone help me?? Thank you.

推荐答案

请卸载protobuf和Tensorflow,然后重新安装Tensorflow,但使用最新版本.显然protobuf的版本也是如此.

please uninstalle protobuf and Tensorflow, then reinstalle Tensorflow but with latest version. Apparently the version of protobuf also.

要更新版本:

pip install -U protobuf

这篇关于Python TypeError:__init __()获得了意外的关键字参数'serialized_options'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆