Reputation: 81
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.
Upvotes: 6
Views: 2291
Reputation: 53
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)
Upvotes: 1
Reputation: 5974
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.Upvotes: 7