Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Launching Tensorboard: bad interpreter: No such file or directory

Tags:

tensorflow

I am unable to run tensorboard, and get the message:

bad interpreter: No such file or directory

Steps to reproduce:

  1. Installed TF on Ubuntu, using a virtenv, and pip as per instructions install instructions

  2. Confirmed TF was correctly installed by running the mnist example. Output was as expected

  3. Attempted to run tensorboard using:

    tensorboard --logdir=/tmp/tensorflow/mnist/logs/mnist_with_summaries/
    

Checked that this location does contain the summary files within the "test" and "train" directories

  1. Command and error:

    (tensorflow_1_4_0) js@pchome01:~$ tensorboard --logdir=/tmp/tensorflow/mnist/logs/mnist_with_summaries/
    bash: /home/js/tensorflow_1_4_0/bin/tensorboard: /home/js/tensorflow_1_3/bin/python3: bad interpreter: No such file or directory
    

In my virtenv folder for tensorflow_1_4_0, a tensorboard script exists:

#!/home/js/tensorflow_1_3/bin/python3
# -*- coding: utf-8 -*-
import re
import sys

from tensorboard.main import main

if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
    sys.exit(main())

When I run the following from the terminal, no errors are reported:

from tensorboard.main import main

Thank you

like image 612
James1587 Avatar asked Nov 25 '25 22:11

James1587


1 Answers

Just spotted my silly mistake and posting the resolution in case others encounter this.

The meaning of the error message is that the interpreter of the code (in this case python3) cannot be found. The first line of the tensorboard script:

#!/home/js/tensorflow_1_3/bin/python3

This tells the compiler to look for python3 at this location, however this path is incorrect and the virtual environment is actually called tensorflow_1_4_0. Therefore changing this line to the following fixed the error:

#!/home/js/tensorflow_1_4_0/bin/python3
like image 81
James1587 Avatar answered Nov 27 '25 12:11

James1587



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!