YOLO_tensorflow icon indicating copy to clipboard operation
YOLO_tensorflow copied to clipboard

Extract weight values from darknet's (.weight) files.

Open Goldit opened this issue 8 years ago • 10 comments

Hi everyone,

Could anyone please show me how to extract weight values from darknet's (.weight) files to run with YOLO_tensorflow?

Thanks

Goldit avatar Aug 02 '16 07:08 Goldit

Hi Goldit,

Did you had any news on this topic? I am also looking to carry out the same task.

Thanks

charterscruz avatar Aug 24 '16 00:08 charterscruz

Hi! I uploaded weight extractor code! I hope it will be useful! Please tell me if there is problem with code:)

gliese581gg avatar Aug 26 '16 04:08 gliese581gg

Hi Gliese.

Thank you very much. This is working perfectly! I have tried the three networks (full, small and tiny).

charterscruz avatar Aug 29 '16 09:08 charterscruz

I've made a fork of darknet with the weight extraction code built in, so it's a little more maintainable hopefully. Check it out here :

https://github.com/mtourne/darknet

mtourne avatar Dec 15 '16 00:12 mtourne

Hi Gliese. I meet a question: after I run yolo in test mode (ex -> ./darknet yolo test cfg/yolo-small.cfg yolo-small.weights),and run "python YOLO_tiny_builder.py", I have not get YOLO_tiny.ckpt ,but get 4 files : YOLO_tiny.ckpt.data-00000-of-00001 YOLO_tiny.ckpt.index YOLO_tiny.ckpt.meta
checkpoint and the size of YOLO_tiny.ckpt.data-00000-of-00001and YOLO_tiny.ckpt.meta is not same as YOLO_tiny.ckpt from https://drive.google.com/file/d/0B2JbaJSrWLpza0FtQlc3ejhMTTA/view?usp=sharing. Could you tell me how to resolve it? thanks.

oplkqingy avatar Feb 09 '17 11:02 oplkqingy

image can you guide me in the first few steps? I do not know how to implement it! thank u very much!!!

wingerboy avatar Jan 04 '18 17:01 wingerboy

  1. Download YOLO_weight_extractor.tar.gz . and tar it.
  2. move to YOLO_weight_extrator
  3. wget https://pjreddie.com/media/files/yolo-tiny.weights
  4. cp darknet_dir/cfg/yolov1-tiny.cfg YOLO_weight_extrator_dir/cfg
  5. ./darknet yolo test cfg/yolov1-tiny.cfg yolo-tiny.weights

cws7777 avatar Jul 18 '18 02:07 cws7777

Hi @gliese581gg,

I am trying to run your code on my MacBook-Air, I run into the following error, "-bash: ./darknet: cannot execute binary file"

When I type in "file darknet", it gives the following output, "darknet: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.24, BuildID[sha1]=a52c46c8cb713865ca5eab71cdccd5cf09610241, with debug_info, not stripped"

Seems like the executable was built for a linux-64 machine. Is there a workaround? Any help would be appreciated. Thank you.

srividhyaprakash avatar Oct 15 '18 23:10 srividhyaprakash

It looks like the YOLO_weight_extractor.tar.gz file is corrupted. I am not able to extract files out of it. Is there an updated version?

harshpal-singh avatar Oct 16 '18 12:10 harshpal-singh

@gliese581gg , @cws7777 heyy but this can only extract weight files of YOLO version one right ? Is there a way to extract yolov2 weights ? Thanks in advance!

Thilanka97 avatar Mar 08 '19 09:03 Thilanka97