先上答案:
python3 -m tensorboard.main --logdir ./ --bind_all
./ 是當前文件夾。
在遠程服務器上執行如下命令啟動tensorboard的服務之后:
tensorboard --logdir logs
無法在本地PC上打開tensorboard的網頁:
http://server_ip:6006
執行tensorboard --logdir logs命令有如下提示:
liguanlin@opt48:/mnt/liguanlin/codes/papercodes/paper_reimplementation/GAN/DCGAN$ tensorboard --logdir logs
2021-03-02 17:08:08.590885: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library 'libcudart.so.10.1'; dlerror: libcudart.so.10.1: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /usr/local/lib:
2021-03-02 17:08:08.590917: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
Serving TensorBoard on localhost; to expose to the network, use a proxy or pass --bind_all
TensorBoard 2.3.0 at http://localhost:6006/ (Press CTRL+C to quit)
log中有這樣一句話:
Serving TensorBoard on localhost; to expose to the network, use a proxy or pass --bind_all
要想成功打開這個網址:
http://server_ip:6006
可以執行如下命令:
tensorboard --logdir logs --bind_all
--bind_all的作用是to expose to the network
Linux alias命令用於設置指令的別名。
用戶可利用alias,自定指令的別名。若僅輸入alias,則可列出目前所有的別名設置。alias的效力僅及於該次登入的操作。若要每次登入是即自動設好別名,可在.profile或.cshrc中設定指令的別名。
zsh: command not found: tensorboard
第一種解決方案:
alias tensorboard='python3 -m tensorboard.main'
第二種解決方案:
python3 -m tensorboard.main --logdir=.
第三種解決方案:
將alias命令放到 .zshrc 里
