由于numpy问题,无法从控制台启动tensorboard

时间:2019-04-04 13:53:59

标签: numpy tensorflow anaconda tensorboard

我想使用TensorBoard。我已经使用 tensorflow.keras.callbacks 库将训练和验证数据与其余项目数据保存在同一目录中。

我已经pip重新安装了numpy,但没有解决。然后我删除了tb-nightly和tensorboard,因为某些原因我都把它们都删除了,只是pip-nightly重新安装了。

(Tensorflow) C:\Users\alias>python -c "print(__import__('numpy').__version__)"
1.16.2

(Tensorflow) C:\Users\alias>python -c "print(__import__('tensorflow').__version__)"
2.0.0-alpha0

(Tensorflow) C:\Users\alias>python -c "print(__import__('tensorboard.version').version.VERSION)"
1.14.0a20190301

在Win10-OS上通过Anaconda提示符调用它时,会发生以下情况:

(Tensorflow) C:\Users\alias>tensorboard --logdir=logs\
TensorBoard 1.14.0a20190301 at http://LAPTOP-4E1BJCAV:6006 (Press CTRL+C to quit)
Traceback (most recent call last):
  File "c:\users\alias\anaconda3\envs\tensorflow\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\users\alias\anaconda3\envs\tensorflow\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\alias\Anaconda3\envs\Tensorflow\Scripts\tensorboard.exe\__main__.py", line 9, in <module>
  File "c:\users\alias\anaconda3\envs\tensorflow\lib\site-packages\tensorboard\main.py", line 58, in run_main
    app.run(tensorboard.main, flags_parser=tensorboard.configure)
  File "c:\users\alias\anaconda3\envs\tensorflow\lib\site-packages\absl\app.py", line 300, in run
    _run_main(main, args)
  File "c:\users\alias\anaconda3\envs\tensorflow\lib\site-packages\absl\app.py", line 251, in _run_main
    sys.exit(main(argv))
  File "c:\users\alias\anaconda3\envs\tensorflow\lib\site-packages\tensorboard\program.py", line 228, in main
    self._register_info(server)
  File "c:\users\alias\anaconda3\envs\tensorflow\lib\site-packages\tensorboard\program.py", line 274, in _register_info
    manager.write_info_file(info)
  File "c:\users\alias\anaconda3\envs\tensorflow\lib\site-packages\tensorboard\manager.py", line 269, in write_info_file
    payload = "%s\n" % _info_to_string(tensorboard_info)
  File "c:\users\alias\anaconda3\envs\tensorflow\lib\site-packages\tensorboard\manager.py", line 129, in _info_to_string
    for k in _TENSORBOARD_INFO_FIELDS
  File "c:\users\alias\anaconda3\envs\tensorflow\lib\site-packages\tensorboard\manager.py", line 129, in <dictcomp>
    for k in _TENSORBOARD_INFO_FIELDS
  File "c:\users\alias\anaconda3\envs\tensorflow\lib\site-packages\tensorboard\manager.py", line 51, in <lambda>
    (dt - datetime.datetime.fromtimestamp(0)).total_seconds()),
OSError: [Errno 22] Invalid argument

很高兴获得一些帮助。

谢谢!

3 个答案:

答案 0 :(得分:0)

您最近进行了全新安装和/或更新吗?

不确定这是否适用于您的情况?昨天,我从头开始安装了适用于python 2.7的最新conda,并在安装后更新为最新软件包。从pycharm或Windows powershell运行python并导入numpy会引发多数组导入错误。对我来说,解决方法是将numpy从?1.16.12降级?到“ 1.5.14”。抱歉,但是遇到错误但我不在电脑上,但是我认为这些版本是正确的。

答案 1 :(得分:0)

我在本地Jupyter笔记本中遇到了相同的错误。升级Numpy软件包对我有用。 尝试如下升级Numpy

pip install numpy==1.16

如果上述方法不起作用,请使用以下命令升级tensorflow并重试

pip install tensorflow --upgrade

答案 2 :(得分:0)

@ Github https://github.com/tensorflow/tensorboard/issues/2092

解决了该问题

感谢支持