簡體   English   中英

如何啟動 Tensorboard?

[英]How do I launch Tensorboard?

我正在關注https://www.tensorflow.org/guide/low_level_intro上的 Tensorflow 介紹性指南,並設法通過使用創建了一個“events.out”文件

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

在我的python文件中並運行它。 下一步是使用“shell 命令” tensorboard --logdir在“終端”中啟動 Tensorboard。 這該怎么做? 我應該使用什么終端? 我試過 windows powershell,但它似乎不起作用。 它給出了錯誤

tensorboard :術語“tensorboard”不被識別為 cmdlet、函數、腳本文件或可操作程序的名稱。 檢查名稱的拼寫,或者如果包含路徑,請驗證路徑是否正確,然后重試。 在行:1 char:1 + tensorboard --logdir + ~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (tensorboard:String) [], CommandNotFoundException +fullyQualifiedErrorId : CommandNotFoundException

使用PowerShell可以。 聽起來您的PATH沒有像其他人所說的那樣配置為查找Tensorboard二進制文件。 你能告訴我pip show tensorflow會得到什么嗎? 它應該如下所示:

(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:

在上面的輸出中,位置是告訴您二進制文件大致放置位置的重要部分。 如果您像TensorFlow安裝指南一樣使用virtualenv(所有內容都應無縫設置,我建議您使用它),則二進制文件應位於c:\\users\\stephanwlee\\venv\\tf\\Scripts 請檢查路徑是否在$env:path

如果上述任何方法均無濟於事,請在響應中添加來自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