张量板:找不到命令

tensorboard: command not found

我按照此处描述的步骤从源代码在我的 MacBook Pro 10.12.5 上安装了 TensorFlow。 https://www.tensorflow.org/install/install_sources

TensorFlow 本身运行良好,但我不能 运行TensorBoard。 tensorboard好像没有安装好

当我尝试 运行ning tensorboard --logdir=... 时,它显示 -bash: tensorboard: command not found。并且 locate tensorboard returns 为空。

我需要任何额外的步骤来安装 tensorboard 吗?

您使用的是哪个版本的 Tensorflow 运行?旧版本不包括 Tensorboard。

如果您确实有更新的版本,我看到您正在使用 OSX,这显然给其他人带来了一些问题:https://github.com/tensorflow/tensorflow/issues/2115检查此页面以修复它!

As a MacPorts user, I'm used to running things from out of the path /opt/local/bin. When you install a python package via MacPorts, that's where the executables go --- even if they're just symbolic links to files to a main python repository in /opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/

pip installs things into the latter directory, but apparently does NOT add the symbolic link to /opt/local/bin

This has never been an issue (or even come up) for me before, because I've only used pip to install (non-executable) packages which load from within python. In conclusion, there is a /opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/tensorboard

This is a pip / MacPorts-SOP mismatch / user error*, and nothing to do with tensorboard in particular. Please close this issue. Thanks for your help.

*my 'locate' database was in the process of updating but hadn't completed

如果其他方法都行不通,那就试试这个吧。它可能对你有帮助.
1.检查Tensorflow的位置

pip show tensorflow

它将显示类似这样的输出。
...
名称:tensorflow
版本:1.4.0
位置:/home/abc/xy/.local/lib/python2.7/site-packages
...
2. 转到您从上述输出中获得的位置。

cd /home/abc/xy/.local/lib/python2.7/site-packages

在那里你可以看到一个名为tensorboard的目录。

cd tensorboard

3。必须有一个名为 'main.py' 的文件。
4.执行以下命令启动tensorboard。

python main.py --logdir=/path/to/log_file/

如果你用Virtualenv安装了Tensorflow,那么首先检查你是否激活了tensorflow环境

如果您激活了 tensorflow 会话,那么您的命令提示符将如下所示:

如果没有,请编写以下命令并再次尝试运行 tensorboard

source ~/tensorflow/bin/activate

您可以像这样将 tensorboard 作为 python 模块调用:

python3 -m tensorboard.main --logdir=~/my/training/dir

或将其添加到您的 .profile

alias tensorboard='python3 -m tensorboard.main'

运行 这个命令:

python3 -m tensorboard.main --logdir=logdir

到运行目录就可以使用了,

将 =logdir 更改为 =""dir/TensorFlow" (目录路径)

最快的解决方案 -

echo "alias tensorboard='python3 -m tensorboard.main'" >> ~/.bash_profile

将此添加到您的 .bash_profile 后,您可以使用

tensorboard --logdir=/path

如果您在 windows 环境中使用 pycharm,这可能会有所帮助: python -m tensorboard.main --logdir=logs