解决Tensorboard端口被占用

报错信息:

E1220 06:55:50.868322 MainThread program.py:267] TensorBoard attempted to bind to port 6006, but it was already in use
E1220 06:55:50.868322 139684389615360 program.py:267] TensorBoard attempted to bind to port 6006, but it was already in use
TensorBoard attempted to bind to port 6006, but it was already in use

导致上面的错误,是由于6006号端口被其他进程所占用。注意,在关闭tensorboard时,应该使用Press CTRL+C to quit,而不是Press CTRL+Z to quit

解决方案一:关掉占用端口的进程:

第一步:查看端口占用:

# 如果找不到lsof命令,则需要下载lsof  $ apt-get install lsof
lsof -i:6006

 结果如下:

COMMAND     PID USER   FD   TYPE  DEVICE SIZE/OFF NODE NAME
tensorboa 21144 root    3u  IPv4 4337149      0t0  TCP *:6006 (LISTEN)

第二步:关掉占用端口的进程

kill -9 21144  # -9表示永久关闭,21144为PID的值

解决方案二:更改Tensorboard启动的默认端口

-------有空再更新----------

 

你可能感兴趣的:(Tensorflow)