Tensorboard visualizes the training files saved on the remote server

I have found too many answers on the Internet, but none of them are clearly written. After working for a long time, I was very desperate, and finally displayed the URL of tensorboard, but the browser could not open it. Finally, she asked her sister for help.

First of all, the trained model file is generally saved like this:
insert image description here
This is the log file on my remote server. If it is copied to the local, it is not a bad idea to open it with the local tensorboard. It is very convenient and the steps are the same. But I don't want to have to download from the server every time I look at the logs.

Step 1: My Macbook, I opened the terminal directly and connected to the remote server

ssh user@IP_address

It’s the code to connect to the server remotely, ssh username@Ip address, if you don’t know how to do this, what remote server should you look at?

Step 2: Switch to the path of your tensorboard

multiai3@multiai3:~$ cd tensorboard_path

Step 3: Enter the virtual environment of your own tensorboard, I assume you have already installed tensorboard,
you can install it directly through pip install tensorboard. If you don't even have a virtual environment...you probably aren't for this tutorial.

# pip install tensorboard
conda activate Yet-jiuqing

Step 4: Use the tensorboard command to view the log file

tensorboard --logdir=20211212-185816/ --port 6018 --host xxx.xxx.xx.xx(你服务器的IP)
# 需要注意的是,logdir=后面是没有空格的,如果你加了空格的话,你要加上引号,比如
# tensorboard --logdir= ‘20211212-185816/’ --port 6018 --host 0.0.0.0
# --port 可以自己设置
# 此外,events.out.tfevents...* 这个文件不需要写到命令里面,它会自动寻找--logdir路径下面的events*
# 当然,--logdir=后面的参数是你的相对路径,你的参数是绝对路径也没关系。但是相对路径一定要输正确,否则会找不到
# 如果有中文,空格之类的也会导致找不到events

Step 5: If all these are OK, then you will get the following result. At this time, you copy the URL and open it in the browser
insert image description here

insert image description here
That's all for now. You can check your saved log files by yourself.

Guess you like

Origin blog.csdn.net/Dongjiuqing/article/details/121900588