I installed tensorboard via pip and when I try to execute tensorboard --logdir= Graph/
I get the following error
Traceback (most recent call last):
File "/home/pawan/.local/bin/tensorboard", line 152, in <module>
Main()
File "/home/pawan/.local/bin/tensorboard", line 102, in Main
module_space = FindModuleSpace()
File "/home/pawan/.local/bin/tensorboard", line 83, in FindModuleSpace
sys.argv[0])
AssertionError: Cannot find .runfiles directory for /home/pawan/.local/bin/tensorboard
I do which tensorboard
and get the following
/home/pawan/.local/bin/tensorboard
thanks in advance.
2 Run this command: python3 -m tensorboard.main --logdir=logdir To run directory you can use, Change =logdir to ="dir/TensorFlow" (Directory path) Share Improve this answer Follow answered Jul 25 '20 at 6:49 shoaib21shoaib21 39055 silver badges99 bronze badges Add a comment | 0 Quickest solution -
Windows OS.Tensorboard output folder is created in folder where file.py is located at running.Therefore if you run example.py from Windows Documents folder you may try this in command prompt: tensorboard --logdir=C:\Users\YourName\Documents\output Thanks for contributing an answer to Stack Overflow!
logdir specifies the directory where TensorBoard will look to find TensorFlow event files that it can display. TensorBoard will recursively walk the directory structure rooted at logdir, looking for .*tfevents.* files. You may also pass a comma separated list of log directories, and TensorBoard will watch each directory.
Say your data is at 'X:\X\file.x' Go in command line to X:\ first. Then type: tensorboard --logdir=X/ NOT tensorboard --logdir='.X/' Show activity on this post.
It seems they didn't consider that someone would be pip-installing TensorBoard in a user directory. Below is my hack to get it to work:
In the ~/.local/bin/tensorboard
script, there's a section that looks like this:
def FindModuleSpace():
# Follow symlinks, looking for my module space
stub_filename = os.path.abspath(sys.argv[0])
while True:
# Found it?
module_space = stub_filename + '.runfiles'
if os.path.isdir(module_space):
break
for mod in site.getsitepackages():
module_space = mod + '/tensorboard/tensorboard' + '.runfiles'
if os.path.isdir(module_space):
return module_space
(just above the assertion with the "Cannot find .runfiles directory" error).
The directory it's looking for is
~/.local/lib/python2.7/site-packages/tensorboard/tensorboard.runfiles
which you can discover by running find ~/.local -name '*runfiles*'
.
I simply added it to the for
loop over directories and all is well:
for mod in site.getsitepackages() + [os.path.expanduser("~/.local/lib/python2.7/site-packages")]
This is a hack because:
python2.7
, which might not be the version of Python you're using. Correct it for your case.os.path.join
would be better.We have to search for the tensorboard folder and run the tensorboard file there.
Search for the tensorflow folder and do the following(My tensorflow folder was there in ~/ itself):
cd ~/tensorflow/lib/python2.7/site-packages/tensorboard
Now run:
python tensorboard --logdir=(the location of your logs path)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With