tensorboard报错:TensorBoard could not bind to port 6006, it was already in use

问题

训练深度学习时,打开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)
tensorboard报错:TensorBoard could not bind to port 6006, it was already in use_第1张图片

你可能感兴趣的:(python,bug,小计,深度学习,python,人工智能)