简体   繁体   English

如何启动 Tensorboard?

[英]How do I launch Tensorboard?

I am following the introductory guide on Tensorflow at https://www.tensorflow.org/guide/low_level_intro , and managed to create an 'events.out' file by using我正在关注https://www.tensorflow.org/guide/low_level_intro上的 Tensorflow 介绍性指南,并设法通过使用创建了一个“events.out”文件

writer = tf.summary.FileWriter('.')
writer.add_graph(tf.get_default_graph())
writer.flush() 

in my python file and running it.在我的python文件中并运行它。 The next step is to launch Tensorboard in a 'terminal' with the 'shell command' tensorboard --logdir .下一步是使用“shell 命令” tensorboard --logdir在“终端”中启动 Tensorboard。 How to do this?这该怎么做? What terminal am I supposed to use?我应该使用什么终端? I tried windows powershell but it does not seem to work.我试过 windows powershell,但它似乎不起作用。 It gives the error它给出了错误

tensorboard : The term 'tensorboard' is not recognized as the name of a cmdlet, function, script file, or operable prog ram. tensorboard :术语“tensorboard”不被识别为 cmdlet、函数、脚本文件或可操作程序的名称。 Check the spelling of the name, or if a path was included, verify that the path is correct and try again.检查名称的拼写,或者如果包含路径,请验证路径是否正确,然后重试。 At line:1 char:1 + tensorboard --logdir + ~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (tensorboard:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException在行:1 char:1 + tensorboard --logdir + ~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (tensorboard:String) [], CommandNotFoundException +fullyQualifiedErrorId : CommandNotFoundException

Using PowerShell is fine. 使用PowerShell可以。 It sounds like your PATH is not configured to find the Tensorboard binary like others are saying. 听起来您的PATH没有像其他人所说的那样配置为查找Tensorboard二进制文件。 Can you show me what you get for pip show tensorflow ? 你能告诉我pip show tensorflow会得到什么吗? It should have something like below: 它应该如下所示:

(1) ➜  ~ pip show tensorflow
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Name: tensorflow
Version: 1.12.0
Summary: TensorFlow is an open source machine learning framework for everyone.
Home-page: https://www.tensorflow.org/
Author: Google Inc.
Author-email: opensource@google.com
License: Apache 2.0
Location: c:\users\stephanwlee\venv\tf\lib\site-packages
Requires: enum34, keras-preprocessing, wheel, astor, backports.weakref, mock, tensorboard, termcolor, protobuf, gast, absl-py, grpcio, six, keras-applications, numpy
Required-by:

In above output, location is the important piece that tells you where binaries are roughly gets placed. 在上面的输出中,位置是告诉您二进制文件大致放置位置的重要部分。 If you are using virtualenv like the TensorFlow installation guide (everything should be set up seamlessly and I would recommend you to use it), the binaries should be in c:\\users\\stephanwlee\\venv\\tf\\Scripts . 如果您像TensorFlow安装指南一样使用virtualenv(所有内容都应无缝设置,我建议您使用它),则二进制文件应位于c:\\users\\stephanwlee\\venv\\tf\\Scripts Please check and see if the path is in $env:path . 请检查路径是否在$env:path

If any of these didn't help, please do add result of pip show tensorflow and $env:path from PowerShell in the response, thanks! 如果上述任何方法均无济于事,请在响应中添加来自PowerShell的pip show tensorflow$env:path的结果,谢谢!

pip show tensorflow
Name: tensorflow
Version: 2.7.0
Summary: TensorFlow is an open source machine learning framework for everyone.
Home-page: https://www.tensorflow.org/
Author: Google Inc.
Author-email: packages@tensorflow.org
License: Apache 2.0
Location: c:\users\luis\appdata\local\packages\pythonsoftwarefoundation.python.3.9_qbz5n2kfra8p0\localcache\local-packages\python39\site-packages
Requires: absl-py, astunparse, flatbuffers, gast, google-pasta, grpcio, h5py, keras, keras-preprocessing, libclang, numpy, opt-einsum, protobuf, six, tensorboard, tensorflow-estimator, tensorflow-io-gcs-filesystem, termcolor, typing-extensions, wheel, wrapt
Required-by:
   LUIS@XEONE5-2620-v2  ~ 
❯
   LUIS@XEONE5-2620-v2  ~ 
❯ $env:path
C:\Program Files\Microsoft MPI\Bin\;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Git\cmd;C:\mingw64\bin;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files\Microsoft SQL Server\150\DTS\Binn\;C:\Program Files\Azure Data Studio\bin;C:\Strawberry\c\bin;C:\Strawberry\perl\site\bin;C:\Strawberry\perl\bin;C:\Program Files\MiKTeX\miktex\bin\x64\;C:\Program Files (x86)\Cracklock\Bin;C:\Users\LUIS\AppData\Local\Microsoft\WindowsApps;C:\Program Files\Azure Data Studio\bin;;C:\Users\LUIS\AppData\Local\Programs\oh-my-posh\bin;C:\Users\LUIS\AppData\Local\Programs\oh-my-posh\themes;D:\Program Files\Microsoft VS Code\bin

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM