RE: Access tensorboard from remote machine

How can I do that? SSH tunnel? Port opening?

Add Comment
1 Answers
Sure, you can use both SSH tunneling and port forwarding to access TensorBoard from a remote machine. Here's a general approach using SSH tunneling: 1. Start the TensorBoard on the remote machine. You can use the following command to do this: ```bash tensorboard --logdir=/path/to/log-directory --port 6006 ``` Replace `/path/to/log-directory` with the path of your log directory. 2. Open a new terminal window on your local machine and create an SSH tunnel with the following command: ```bash ssh -N -f -L localhost:16006:localhost:6006 user@your_remote_host ``` Replace `user` with your username on the remote machine, and `your_remote_host` with the address of the remote machine. After running this command, all connections to `localhost:16006` on your local machine will be forwarded to `localhost:6006` on the remote machine. 3. Open a web browser on your local machine and visit `localhost:16006`. You should see the TensorBoard interface. And this is how you can achieve it with the help of port forwarding: 1. Start the TensorBoard on the remote machine and specify a port number you want it to use (the default is 6006 as above). ```bash tensorboard --logdir=/path/to/log-directory --port 6006 ``` 2. On your router, you'll need to set up port forwarding rules so that any external traffic aimed at the external IP of your router on a specific port gets forwarded to the internal IP of your machine running TensorBoard on the specific port it's running on. This usually involves going to the admin page of your router (often `192.168.0.1` or `192.168.1.1`), finding the area related to Port Forwarding, and then adding a rule for TCP traffic on the TensorBoard port (default `6006`) to be forwarded to the same port on the machine specific IP address. 3. Now TensorBoard should be accessible from outside your network at: `http://your_public_ip:6006` Note: Be aware of possible security implications when exposing a local server like TensorBoard to the public internet. It might be a good idea to restrict access in some way such as whitelisting certain IPs, etc. Remember that in both methods, replace 6006 with the port on which your TensorBoard is originally running if it's different.
Answered on August 24, 2023.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.