tensorboard learning – several methods to solve the problem of tensorboard attempted to bind to port 6006, but it was already in use

When viewing the training generation results with tensorboard,

The command to view is (point logdir to the result directory where your training is saved):

tensorboard --logdir=yourpath/train_dir

Encountered the following error:

[MainThread program.py:262] TensorBoard attempted to bind to port 6006, but it was already in use

Literally means that port 6006 is occupied, there are the following solutions:

Solution one:

The reference solutions searched online are:

Type in the terminal

lsof -i:6006

At this time, you will find in the terminal

COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
tensoroa 19676 hjxu 3u IPv4 196245 0t0 TCP *:x11-6 (LISTEN)
and then close the port 19676 (depending on your actual output)

kill -9 19676

Then execute the above command using tensorboard;

Solution two:

(Interjection, if you are running under windows, it is recommended to use Google Chrome, and the version is higher. Reference: [tensorboard cannot be opened] )

Specify a new port to view

tensorboard --logdir=yourpath/train_dir --port=6008

Refer to the instructions I wrote and specify a new port number for port to view, such as port number: 8800

If you are using a proxy to access the Internet and still encounter the error reported above, please turn off your Internet proxy first.

Method 2 is effective for personal testing.

Leave a Comment

Your email address will not be published. Required fields are marked *