Search code examples
ubuntutensorflowtensorboard

TensorBoard could not bind to port 6006, it was already in use


I already closed the Tensorboard before, but after I open new terminal and re-run the command tensorboard --logdir /tmp/retrain_logs, it produces following error:

E0128 12:24:08.469702 MainThread program.py:201] TensorBoard could not bind to port 6006, it was already in use

E0128 12:24:08.469702 140707008960320 program.py:201] 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

Anybody knows the how could this happen? I can easily restart the PC, but now I'm in the middle of training my dataset (unfortunately I haven't set checkpoint) so I don't want to terminate it.


Solution

  • Sometimes, the port continues to be occupied in spite of ending the instance.

    In that case,

    you can first check if your port is still occupied by:

    lsof -i:6006
    

    and then, using the PID listed above to kill the tcp instance:

    kill -9 PID