Darknet: Running without display

Created on 7 Sep 2017  ·  16Comments  ·  Source: pjreddie/darknet

Hello,
I am trying to create a script that run YOLO on a videofile filmed by a camera. When I have a display it runs fine but when running in terminal I get an error about running without display.

How can I run without display, thankful for any help!

⋊> /o/darknet on master ⨯ ./darknet detector demo cfg/coco.data cfg/yolo.cfg yolo.weights /docker/unifi-video/videos/6c97873f-4845-3fcc-a9c1-747f19fe995c/2017/09/01/1504285393085_1504285395085_1504282143334_904756976.mp4
Demo
layer     filters    size              input                output
    0 conv     32  3 x 3 / 1   608 x 608 x   3   ->   608 x 608 x  32
    1 max          2 x 2 / 2   608 x 608 x  32   ->   304 x 304 x  32
    2 conv     64  3 x 3 / 1   304 x 304 x  32   ->   304 x 304 x  64
    3 max          2 x 2 / 2   304 x 304 x  64   ->   152 x 152 x  64
    4 conv    128  3 x 3 / 1   152 x 152 x  64   ->   152 x 152 x 128
    5 conv     64  1 x 1 / 1   152 x 152 x 128   ->   152 x 152 x  64
    6 conv    128  3 x 3 / 1   152 x 152 x  64   ->   152 x 152 x 128
    7 max          2 x 2 / 2   152 x 152 x 128   ->    76 x  76 x 128
    8 conv    256  3 x 3 / 1    76 x  76 x 128   ->    76 x  76 x 256
    9 conv    128  1 x 1 / 1    76 x  76 x 256   ->    76 x  76 x 128
   10 conv    256  3 x 3 / 1    76 x  76 x 128   ->    76 x  76 x 256
   11 max          2 x 2 / 2    76 x  76 x 256   ->    38 x  38 x 256
   12 conv    512  3 x 3 / 1    38 x  38 x 256   ->    38 x  38 x 512
   13 conv    256  1 x 1 / 1    38 x  38 x 512   ->    38 x  38 x 256
   14 conv    512  3 x 3 / 1    38 x  38 x 256   ->    38 x  38 x 512
   15 conv    256  1 x 1 / 1    38 x  38 x 512   ->    38 x  38 x 256
   16 conv    512  3 x 3 / 1    38 x  38 x 256   ->    38 x  38 x 512
   17 max          2 x 2 / 2    38 x  38 x 512   ->    19 x  19 x 512
   18 conv   1024  3 x 3 / 1    19 x  19 x 512   ->    19 x  19 x1024
   19 conv    512  1 x 1 / 1    19 x  19 x1024   ->    19 x  19 x 512
   20 conv   1024  3 x 3 / 1    19 x  19 x 512   ->    19 x  19 x1024
   21 conv    512  1 x 1 / 1    19 x  19 x1024   ->    19 x  19 x 512
   22 conv   1024  3 x 3 / 1    19 x  19 x 512   ->    19 x  19 x1024
   23 conv   1024  3 x 3 / 1    19 x  19 x1024   ->    19 x  19 x1024
   24 conv   1024  3 x 3 / 1    19 x  19 x1024   ->    19 x  19 x1024
   25 route  16
   26 conv     64  1 x 1 / 1    38 x  38 x 512   ->    38 x  38 x  64
   27 reorg              / 2    38 x  38 x  64   ->    19 x  19 x 256
   28 route  27 24
   29 conv   1024  3 x 3 / 1    19 x  19 x1280   ->    19 x  19 x1024
   30 conv    425  1 x 1 / 1    19 x  19 x1024   ->    19 x  19 x 425
   31 detection
mask_scale: Using default '1.000000'
Loading weights from yolo.weights...Done!
video file: /docker/unifi-video/videos/6c97873f-4845-3fcc-a9c1-747f19fe995c/2017/09/01/1504285393085_1504285395085_1504282143334_904756976.mp4
Failed to connect to Mir: Failed to connect to server socket: No such file or directory
Unable to init server: Could not connect: Connection refused

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

Most helpful comment

@srhtyldz You can use this repository: https://github.com/AlexeyAB/darknet
Just run with -dont_show flag:
./darknet detector demo cfg/coco.data cfg/yolo.cfg yolo.weights -dont_show test.mp4

All 16 comments

I am having the same prob with images ..did you solve this?

No I haven't found a sollution for this.

No problem brother, I just got it fixed

On Sep 10, 2017 5:18 PM, "Christian Ek" notifications@github.com wrote:

No I haven't found a sollution for this.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/pjreddie/darknet/issues/189#issuecomment-328337627,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AeU7BgSsgkWF-67JfP_42oVqQxU92qcHks5sg8yqgaJpZM4PQLWV
.

Care to share how? :-) :+1:

Id also like to know how to fix this.

I don't know if you guys have the same prob exactly...when I downloaded
weights file I got 3 weight files , and in the shell code of detection it
was using only first weight file...so check out the names of those weight
files ..in my case it was ' weights' 'weights.1' and 'weights.2 ' ..now in
the code where image is to be compared try with 'weights.2' and 'weights.1'
...by default you must have been using 'weights'

On Sep 12, 2017 11:36 AM, "Christian Ek" notifications@github.com wrote:

Care to share how? :-) 👍


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/pjreddie/darknet/issues/189#issuecomment-328747271,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AeU7BhZInCiAd04_DGTZJMsl1MK4Ujpvks5shh-AgaJpZM4PQLWV
.

That wasnt my problem.
My problem was fixed by this:
https://unix.stackexchange.com/questions/94835/simulate-x-screen

Ohh.. apologies mate

On Sep 14, 2017 2:48 PM, "Christian Ek" notifications@github.com wrote:

That wasnt my problem.
My problem was fixed by this:
https://unix.stackexchange.com/questions/94835/simulate-x-screen


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/pjreddie/darknet/issues/189#issuecomment-329424173,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AeU7Bl87_o0uGX6dCDqvYz0ak6fk7OSbks5siO90gaJpZM4PQLWV
.

Looks like a local xserver (x-forwarding) issue to render the graphics (video/image)...

ssh -X -i @

Did you find a way to do that ? I need it as well

@srhtyldz You can use this repository: https://github.com/AlexeyAB/darknet
Just run with -dont_show flag:
./darknet detector demo cfg/coco.data cfg/yolo.cfg yolo.weights -dont_show test.mp4

@srhtyldz You can use this repository: https://github.com/AlexeyAB/darknet
Just run with -dont_show flag:
./darknet detector demo cfg/coco.data cfg/yolo.cfg yolo.weights -dont_show test.mp4

How could we implement folder of the image ?

I mean that I train whole folder image instead of one file of video.

./darknet detector demo cfg/coco.data cfg/yolo.cfg yolo.weights -dont_show data/obj/

Is supposed to be correct ?

@srhtyldz You can use this repository: https://github.com/AlexeyAB/darknet
Just run with -dont_show flag:
./darknet detector demo cfg/coco.data cfg/yolo.cfg yolo.weights -dont_show test.mp4

I put ' - dont_show ' only like that ./darknet detector demo cfg/coco.data cfg/yolo.cfg yolo.weights -dont_show -map and still get logs and this is problem for me . Can you please help me about this problem ?

Yep its still not working
Getting the same error below:
Cannot load image "-dont_show"
-dont_show: Predicted in 0.424597 seconds.

(predictions:7955): Gtk-WARNING **: cannot open display:

@srhtyldz You can use this repository: https://github.com/AlexeyAB/darknet
Just run with -dont_show flag:
./darknet detector demo cfg/coco.data cfg/yolo.cfg yolo.weights -dont_show test.mp4

I put ' - dont_show ' only like that ./darknet detector demo cfg/coco.data cfg/yolo.cfg yolo.weights -dont_show -map and still get logs and this is problem for me . Can you please help me about this problem ?

Hello,
I am trying to create a script that run YOLO on a videofile filmed by a camera. When I have a display it runs fine but when running in terminal I get an error about running without display.

How can I run without display, thankful for any help!

⋊> /o/darknet on master ⨯ ./darknet detector demo cfg/coco.data cfg/yolo.cfg yolo.weights /docker/unifi-video/videos/6c97873f-4845-3fcc-a9c1-747f19fe995c/2017/09/01/1504285393085_1504285395085_1504282143334_904756976.mp4
Demo
layer     filters    size              input                output
    0 conv     32  3 x 3 / 1   608 x 608 x   3   ->   608 x 608 x  32
    1 max          2 x 2 / 2   608 x 608 x  32   ->   304 x 304 x  32
    2 conv     64  3 x 3 / 1   304 x 304 x  32   ->   304 x 304 x  64
    3 max          2 x 2 / 2   304 x 304 x  64   ->   152 x 152 x  64
    4 conv    128  3 x 3 / 1   152 x 152 x  64   ->   152 x 152 x 128
    5 conv     64  1 x 1 / 1   152 x 152 x 128   ->   152 x 152 x  64
    6 conv    128  3 x 3 / 1   152 x 152 x  64   ->   152 x 152 x 128
    7 max          2 x 2 / 2   152 x 152 x 128   ->    76 x  76 x 128
    8 conv    256  3 x 3 / 1    76 x  76 x 128   ->    76 x  76 x 256
    9 conv    128  1 x 1 / 1    76 x  76 x 256   ->    76 x  76 x 128
   10 conv    256  3 x 3 / 1    76 x  76 x 128   ->    76 x  76 x 256
   11 max          2 x 2 / 2    76 x  76 x 256   ->    38 x  38 x 256
   12 conv    512  3 x 3 / 1    38 x  38 x 256   ->    38 x  38 x 512
   13 conv    256  1 x 1 / 1    38 x  38 x 512   ->    38 x  38 x 256
   14 conv    512  3 x 3 / 1    38 x  38 x 256   ->    38 x  38 x 512
   15 conv    256  1 x 1 / 1    38 x  38 x 512   ->    38 x  38 x 256
   16 conv    512  3 x 3 / 1    38 x  38 x 256   ->    38 x  38 x 512
   17 max          2 x 2 / 2    38 x  38 x 512   ->    19 x  19 x 512
   18 conv   1024  3 x 3 / 1    19 x  19 x 512   ->    19 x  19 x1024
   19 conv    512  1 x 1 / 1    19 x  19 x1024   ->    19 x  19 x 512
   20 conv   1024  3 x 3 / 1    19 x  19 x 512   ->    19 x  19 x1024
   21 conv    512  1 x 1 / 1    19 x  19 x1024   ->    19 x  19 x 512
   22 conv   1024  3 x 3 / 1    19 x  19 x 512   ->    19 x  19 x1024
   23 conv   1024  3 x 3 / 1    19 x  19 x1024   ->    19 x  19 x1024
   24 conv   1024  3 x 3 / 1    19 x  19 x1024   ->    19 x  19 x1024
   25 route  16
   26 conv     64  1 x 1 / 1    38 x  38 x 512   ->    38 x  38 x  64
   27 reorg              / 2    38 x  38 x  64   ->    19 x  19 x 256
   28 route  27 24
   29 conv   1024  3 x 3 / 1    19 x  19 x1280   ->    19 x  19 x1024
   30 conv    425  1 x 1 / 1    19 x  19 x1024   ->    19 x  19 x 425
   31 detection
mask_scale: Using default '1.000000'
Loading weights from yolo.weights...Done!
video file: /docker/unifi-video/videos/6c97873f-4845-3fcc-a9c1-747f19fe995c/2017/09/01/1504285393085_1504285395085_1504282143334_904756976.mp4
Failed to connect to Mir: Failed to connect to server socket: No such file or directory
Unable to init server: Could not connect: Connection refused

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

I am also getting same problem
and
i have tried with flag -dont_show and --display 0
but its not working still
Need help...

I also faced the same, but resolved by updating "config file".
There might be some unbalanced "[" or "#" characters.

Solution 1: Update your config file as in this format 👉 https://github.com/pjreddie/darknet/blob/master/cfg/yolov3.cfg

Solution 2: For some, using -dont_show flag in detection command has worked.
eg: !./darknet detector test data/obj.data cfg/yolov3_V1_config.cfg /mydrive/yolov3_V1_config_last.weights /mydrive/yolov3/Poachers/pic2.jpg -thresh 0.3 -dont_show

Was this page helpful?
0 / 5 - 0 ratings