thtrieu / darkflow

Translate darknet to tensorflow. Load trained weights, retrain/fine-tune using tensorflow, export constant graph def to mobile devices
GNU General Public License v3.0
6.14k stars 2.08k forks source link

Error when using "--savepb" and "--trainer adam" together #977

Open victorssilva opened 5 years ago

victorssilva commented 5 years ago

This:

$ flow --model cfg/tiny-yolo-voc.cfg --trainer adam --train --gpu 0.8 --dataset test/training/images --annotation test/training/annotations --savepb --epoch 20

triggers the following:

Traceback (most recent call last): File "/home/victor/ml/bootcamp/venv/bin/flow", line 7, in exec(compile(f.read(), file, 'exec')) File "/home/victor/ml/bootcamp/darkflow/flow", line 6, in cliHandler(sys.argv) File "/home/victor/ml/bootcamp/darkflow/darkflow/cli.py", line 39, in cliHandler tfnet.savepb(); exit('Done') File "/home/victor/ml/bootcamp/darkflow/darkflow/net/build.py", line 161, in savepb darknet_pb = self.to_darknet() File "/home/victor/ml/bootcamp/darkflow/darkflow/net/help.py", line 162, in to_darknet l_idx = int(var_name[0]) ValueError: invalid literal for int() with base 10: 'beta1_power'

to_darknet seems to be trying to serialize Adam-related variables and barfing as they don't follow the pattern of ['22', 'convolutional/kernel'] but rather come as a list with a single value - ['beta1_power'].

Should those be saved? If so, what would be the expected format for them?

uwieske commented 5 years ago

I am experiencing the same problem. I am also training with adam. At the end of the training process the following error occurred:

/darkflow/darkflow/net/help.py", line 162, in to_darknet l_idx = int(var_name[0]) ValueError: invalid literal for int() with base 10: 'beta1_power'
NunoCalejo commented 5 years ago

I have the same issue. Does anyone know how to solve it?

dspasyuk commented 4 years ago

You will need to add try: except ValueError in help module, "/usr/local/lib/python3.6/dist-packages/darkflow/net/help.py", line 163