Tensorboard TypeError:__ init __()得到了一个意外的关键字参数' file'

时间:2018-05-10 09:43:16

标签: python tensorflow pip tensorboard

我使用tensorboard --logdir=I:\logs在cmd中启动tensorboard 1.8.0。错误:

I:\> tensorboard --logdir=I:\logs
Traceback (most recent call last):
  File "c:\python35\lib\runpy.py", line 184, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\python35\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\Administrator\AppData\Roaming\Python\Python35\Scripts\tensorboard.exe\__main__.py", line 5, in <module>
  File "C:\Users\Administrator\AppData\Roaming\Python\Python35\site-packages\tensorboard\main.py", line 30, in <module>
    from tensorboard import default
  File "C:\Users\Administrator\AppData\Roaming\Python\Python35\site-packages\tensorboard\default.py", line 35, in <module>
    from tensorboard.plugins.audio import audio_plugin
  File "C:\Users\Administrator\AppData\Roaming\Python\Python35\site-packages\tensorboard\plugins\audio\audio_plugin.py", line 30, in <module>
    from tensorboard.plugins.audio import metadata
  File "C:\Users\Administrator\AppData\Roaming\Python\Python35\site-packages\tensorboard\plugins\audio\metadata.py", line 22, in <module>
    from tensorboard.plugins.audio import plugin_data_pb2
  File "C:\Users\Administrator\AppData\Roaming\Python\Python35\site-packages\tensorboard\plugins\audio\plugin_data_pb2.py", line 63, in <module>
    options=None, file=DESCRIPTOR),
TypeError: __init__() got an unexpected keyword argument 'file'

2 个答案:

答案 0 :(得分:3)

尝试升级protobuf

pip install --upgrade protobuf

答案 1 :(得分:0)

我遇到了同样的错误。将tensorflow == 1.8.0安装到同一个环境中对我有帮助。 现在这适用于Windows 10.而GPU上的训练仍然有效。

pip freeze

absl-py==0.2.0                                                                                                                      
astor==0.6.2                                                                                                            
bleach==1.5.0                                                                                                           
certifi==2018.4.16                                                                                                      
gast==0.2.0                                                                                                             
grpcio==1.11.0                                                                                                          
h5py==2.7.1                                                                                                             
html5lib==0.9999999                                                                                                     
Keras==2.1.6                                                                                                            
Markdown==2.6.11                                                                                                        
numpy==1.14.3                                                                                                           
olefile==0.45.1                                                                                                         
Pillow==4.2.1                                                                                                           
protobuf==3.5.2.post1                                                                                                   
PyYAML==3.12                                                                                                            
scipy==1.0.0                                                                                                            
Shapely==1.6.2                                                                                                          
six==1.11.0                                                                                                             
tensorboard==1.8.0                                                                                                      
tensorflow==1.8.0                                                                                                       
tensorflow-gpu==1.8.0                                                                                                   
termcolor==1.1.0                                                                                                        
Werkzeug==0.14.1                                                                                                        
wincertstore==0.2    

对不起冗余模块......