Darknet: Gtk-WARNING **: cannot open display: :0.0 when running darknet on google cloud instance

Created on 18 Jul 2018  路  5Comments  路  Source: AlexeyAB/darknet

screenshot from 2018-07-18 13-27-30
After training, when I tested the model it is not able to show me the output. I have tried setting various options like :
Setting Display = 0.0
Appending export Display = 1 in /.bashrc
Tried to set by using xhost +
But still not getting output
Ubuntu : 16.04
Cuda : 8.0
OpenCv : 3.4.0

Most helpful comment

If you want to see result image, then you should setup remote display over ssh: https://www.google.com/search?q=display+over+ssh&rlz=1C1MSIM_enRU714RU714&oq=display+over+ssh&aqs=chrome..69i57j0l5.3007j0j7&sourceid=chrome&ie=UTF-8


Or just to avoid this error, try to add flag -dont_show at the end of your command. For example:
./darknet detector test data/obj.data yolo-obj.cfg yolo-obj.weights -dont_show

And then copy predictions.jpg to your computer and see it.

All 5 comments

If you want to see result image, then you should setup remote display over ssh: https://www.google.com/search?q=display+over+ssh&rlz=1C1MSIM_enRU714RU714&oq=display+over+ssh&aqs=chrome..69i57j0l5.3007j0j7&sourceid=chrome&ie=UTF-8


Or just to avoid this error, try to add flag -dont_show at the end of your command. For example:
./darknet detector test data/obj.data yolo-obj.cfg yolo-obj.weights -dont_show

And then copy predictions.jpg to your computer and see it.

Similar Question:
How could I transfer video to a output video file?

On GCP:
root@dl-tf:~/AlexeyAB-darknet# /root/darknet/darknet detector demo ./cfg/coco.data ./cfg/yolov2.cfg /root/yolo-file/yolov2.weights /root/yolo-file/Megamind.avi -i 0 -thresh 0.25
Demo
layer filters size input output
0 conv 32 3 x 3 / 1 416 x 416 x 3 -> 416 x 416 x 32 0.299 BFLOPs
1 max 2 x 2 / 2 416 x 416 x 32 -> 208 x 208 x 32

29 conv 1024 3 x 3 / 1 13 x 13 x1280 -> 13 x 13 x1024 3.987 BFLOPs
30 conv 425 1 x 1 / 1 13 x 13 x1024 -> 13 x 13 x 425 0.147 BFLOPs
31 detection
mask_scale: Using default '1.000000'
Loading weights from /root/yolo-file/yolov2.weights...Done!
video file: /root/yolo-file/Megamind.avi

(Demo:13215): Gtk-WARNING **: cannot open display:

@JeffCC

./darknet detector demo data/obj.data yolo-obj.cfg yolo-obj.weights test.mp4 -dont_show -out_filename res.avi

For training on cloud (for example Amazon EC2) - read this: https://github.com/AlexeyAB/darknet/issues/1380#issuecomment-412333942

If you want to see result image, then you should setup remote display over ssh: https://www.google.com/search?q=display+over+ssh&rlz=1C1MSIM_enRU714RU714&oq=display+over+ssh&aqs=chrome..69i57j0l5.3007j0j7&sourceid=chrome&ie=UTF-8

Or just to avoid this error, try to add flag -dont_show at the end of your command. For example:
./darknet detector test data/obj.data yolo-obj.cfg yolo-obj.weights -dont_show

And then copy predictions.jpg to your computer and see it.

-dont_show works for me. I ran darknet in a docker

I am running a similar command, but instead of trianing, I am using demo. So:

darknet detector demo cfg/final.data cfg/final.cfg weights/final.weights video_input.mp4 -dont_show -out_filename video-output.mp4

and I still get:

layer     filters    size              input                output
    0 conv     32  3 x 3 / 1   416 x 416 x   3   ->   416 x 416 x  32  0.299 BFLOPs
...
...
...
   31 detection
mask_scale: Using default '1.000000'
Loading weights from weights/final.weights...Done!
video file: video_input.mp4
Unable to init server: Could not connect: Connection refused

(Demo:7565): Gtk-WARNING **: 18:26:51.029: cannot open display:

EDIT: RESOLVED. I was running the pjreddie version of darknet, my bad.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

HanSeYeong picture HanSeYeong  路  3Comments

Greta-A picture Greta-A  路  3Comments

qianyunw picture qianyunw  路  3Comments

PROGRAMMINGENGINEER-NIKI picture PROGRAMMINGENGINEER-NIKI  路  3Comments

off99555 picture off99555  路  3Comments