philipperemy / yolo-9000

YOLO9000: Better, Faster, Stronger - Real-Time Object Detection. 9000 classes!
Apache License 2.0
1.18k stars 309 forks source link

Cant convert 9k weights to h5 #34

Closed fcu-d0239468 closed 5 years ago

fcu-d0239468 commented 5 years ago

these are the errors Using TensorFlow backend. Loading weights. Weights Header: [ 0 1 0 15501312] Parsing Darknet config. Traceback (most recent call last): File "yad2k.py", line 270, in _main(parser.parse_args()) File "yad2k.py", line 91, in _main cfg_parser.read_file(unique_config_file) File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\configparser.py", line 718, in read_file self._read(f, source) File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\configparser.py", line 1092, in _read fpname, lineno) configparser.DuplicateOptionError: While reading from '<???>' [line 8]: option 'batch' in section 'net_0' already exists still cant understand why

fcu-d0239468 commented 5 years ago

and yet i've tried keras-yolo3 convert.py also Using TensorFlow backend. Loading weights. Weights Header: 0 1 0 [15501312] Parsing Darknet config. Traceback (most recent call last): File "convert.py", line 262, in _main(parser.parse_args()) File "convert.py", line 85, in _main cfg_parser.read_file(unique_config_file) File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\configparser.py", line 718, in read_file self._read(f, source) File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\configparser.py", line 1092, in _read fpname, lineno) configparser.DuplicateOptionError: While reading from '<???>' [line 8]: option 'batch' in section 'net_0' already exists and holding the same issue as well could anyone help?

philipperemy commented 5 years ago

@fcu-d0239468 hum not sure why.

shridhar-pivotchain commented 5 years ago

comment batch=1 subdivisions=1 on 8th and 9th line in yolo9000.cfg file

philipperemy commented 5 years ago

@shridhar-pivotchain did it work by doing that?

shridhar-pivotchain commented 5 years ago

yes

philipperemy commented 5 years ago

@shridhar-pivotchain can you give a bit of background of what was it for?

philipperemy commented 5 years ago

I'm asking that because if it could help other users, then we can add it to the README.

shridhar-pivotchain commented 5 years ago

In yolo9000.cfg batch=1 and subdivisions=1 has got repeated on 8th and 9th line respectively while converting weights to keras an error is thrown 'configparser.DuplicateOptionError: While reading from '<???>' [line 8]: option 'batch' in section 'net_0' already exists' To avoide this error comment batch=1 and subdivisions=1 in config file

philipperemy commented 5 years ago

@shridhar-pivotchain sure. so you take this .weight file and you convert it to .h5 file to be used for Keras? @shridhar-pivotchain Can you provide some code here? It might be interested for other people.

shridhar-pivotchain commented 5 years ago

Use https://github.com/allanzelener/YAD2K git for converting weights.

philipperemy commented 5 years ago

@shridhar-pivotchain awesome thank you! Going to update the README

philipperemy commented 5 years ago

@fcu-d0239468 hope this helped!