SoFunction
Updated on 2024-11-16

How to use tensorboard on linux server

1. When using the tensorboard command, instead of looking for the tensorboard in the virtual environment, look for it in the (global path) (/home/ljx/.local/lib/python3.9/site-packages/tensorboard)

tensorboard --logdir="/home/ljx/BertSum/models/bert_transformer/"

2. Use the which command to check the path of the tensorboard used, and find that the global path is used, not the virtual environment path.

which tensorboard

3. Check environment variablesPATHTo ensure that virtual environments arebinCatalog in front.

echo $PATH

echo $PATH is a command used in a command line interface (such as the Bash shell) on Unix-like systems (including Linux and macOS). This command prints out the current user's environment variablesPATH The value of the

environment variablePATH is a special variable that defines the directory where the operating system searches for executables. It contains a list of directory paths thatThe operating system looks for the executable file corresponding to the command entered by the user in the order of these paths

In the output, the global path is before the virtual environment path, so it first goes to find the tensorboard in the global path, but there is no up-to-date tensorboard globally, resulting in an error report

4. Adjust environment variables to ensure thatPrioritization of virtual environments

After activating the virtual environment, the virtual environment'sbinThe catalog should appear in the$PATHvariables at the top of the list. Environment variables can be manually adjusted to ensure that the virtual environment's directories have the highest priority. ---first to be looked up in the virtual environment

export PATH=/home/ljx/anaconda3/envs/pytorch/bin:$PATH

pytorch is the name of the virtual environment

5. Re-execute the command and the tensorboard starts successfully.

tensorboard --logdir="/home/ljx/BertSum/models/bert_classifier/" --bind_all

With the --bind_all parameter, you can access the address on the server locally, simply replacing the ip

--bind_all: This parameter instructs TensorBoard to listen to all network interfaces so that it can be accessed from any machine, not just the local one. This is useful when you need to access the TensorBoard remotely.

6. Access the server's IP address plus port number in your local browser to view the

http://localhost:6006/

Replace localhost with the server's ip

To this article on the use of tensorboard in linux servers on the article is introduced to this, more related linux servers using tensorboard content, please search for my previous articles or continue to browse the following related articles I hope you will support me in the future!