问题
训练深度学习时,打开TensorBoard发生报错:TensorBoard could not bind to port 6006, it was already in use ERROR: TensorBoard could not bind to port 6006, it was already in use
tensorboard --logdir='/home/ubuntu/xxx/logs' --port='6006'
报错信息如下:
E1108 13:48:08.055952 139724834817856 program.py:298] TensorBoard could not bind to port 6006, it was already in use
ERROR: TensorBoard could not bind to port 6006, it was already in use
解决方法
关闭之前的端口进程,具体操作如下:
输入:
lsof -i:6006
输出:
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
tensorboa 3094950 ubuntu xx xxxxx xxxxxxxxxx xxxx xxxxxxxxxxxxx (LISTEN)
输入:
kill -9 3094950
再次输入,即可正常使用:
tensorboard --logdir='/home/ubuntu/xxx/logs' --port='6006'
Serving TensorBoard on localhost; to expose to the network, use a proxy or pass --bind_all
TensorBoard 2.10.1 at http://localhost:6006/ (Press CTRL+C to quit)