tensorboard[pytorch]: a method to train on the linux side and open on the windows side

The training file is run on the linux side of the server. Since it is not connected to the server interface, you want to view the images generated by tensorboard during the training process on the webpage on the Windows side to check the training status. Methods as below:

First, on the windows side, open the cmd command interface, and enter the following command in the command interface to connect to your server:

ssh -L 16006:127.0.0.1:6006 [email protected]

Here, account represents the name of the server, and server.address represents the address of the server; after entering, enter the verification password on the server side to connect to the server on the window side. After the connection is successful, the interface is as follows:

After that, enter the log_dir directory you configured, take my code as an example:

run_dir = os.path.join(checkpoint_path,"run")
writer = SummaryWriter(log_dir=run_dir)

The log_dir directory I configured is "checkpoint_path/run", then I want to enter the current "checkpoint_path" directory:

In the xftp file, this is the current directory:

 

After entering the current directory on the cmd side, run the "tensorboard --logdir run/" command:

tensorboard --logdir run/

After a while, the following words will appear on the interface:

At this point, you can open the webpage on the window side, enter "http://127.0.0.1:16006/" or "http://localhost:16006/" in the address bar, and then the image file will be opened!

 

 It ends here!

Reference: https://blog.csdn.net/qq_31225201/article/details/124010570

Guess you like

Origin blog.csdn.net/power_kaikaige/article/details/125111527