Display remote server tensorboard visualization on local computer

1. The current environment

This machine is a windows system, and the tensorbord program runs on the remote server, and usually needs to be displayed locally. The problem of locally displaying the remote server tensorbord has been solved. The following tutorials are carried out on the premise that the server environment is configured and tensorbord can be successfully run.

2. The remote server is not displayed locally

Because the local port of the server accessed by the link, but we enter the URL in the local browser, the target ip cannot be found, that is, the tensorbord cannot be displayed locally.

3. Solutions

(1), connect through xshell

Establish an ssh tunnel to forward the remote port to the local port. The remote listening port is the default 6006 port of tensorboard (you can also define it yourself), and any non-occupied local port can be used.

Open a connection in Xshell, create a new session->ssh->tunnel->add, type local (dial-out), fill in 127.0.0.1 (meaning local) for the source host, and set a listening port, such as 6006 (local arbitrary The non-occupied port can be used), the target host is local to the server, and the target port is 6006. If it is occupied, you can define other ports by yourself.
insert image description here
The default port of tensorboard is 6006. If you change the default port, you can change it by --port port number.
Then enter the command on the server again:

tensorboard --logdir=log_dir  --port 6006

Copy the link and open the webpage 127.0.0.1:6006 on the local machine to
successfully access the remote tensorboard.

(2), link through ssh

When connecting to ssh, redirect the server's port 6006 (the port number specified by tensorord) to your own machine:

ssh -L 16006:127.0.0.1:6006 username@remote_server_ip

Among them: 16006:127.0.0.1 represents port 16006 on your own machine, and 6006 is the port used by tensorboard on the server. username@remote_server_ip : username is the username on the server; remote_server_ip is the ip address
of the server Use port 6006 on the server to start tensorboard normally:

tensorboard --logdir=xxx --port=6006

Enter the address in your local browser:

127.0.0.1:16006

Guess you like

Origin blog.csdn.net/qq_52302919/article/details/123871555