Borda / keras-yolo3

A Keras implementation of YOLOv3 (Tensorflow backend) a successor of qqwweee/keras-yolo3
MIT License
31 stars 10 forks source link

Turn of data augmentation for validation set #3

Closed KeKsBoTer closed 5 years ago

KeKsBoTer commented 5 years ago

IMO the data augmentation should be turned of for the validation set. This was also discussed here

Borda commented 5 years ago

the solution should be set randomize=False but it seems that there is an issue:

Traceback (most recent call last):
  File "/home/jb/Applications/pycharm-2019/helpers/pydev/pydevd.py", line 1758, in <module>
    main()
  File "/home/jb/Applications/pycharm-2019/helpers/pydev/pydevd.py", line 1752, in main
    globals = debugger.run(setup['file'], None, None, is_module)
  File "/home/jb/Applications/pycharm-2019/helpers/pydev/pydevd.py", line 1147, in run
    pydev_imports.execfile(file, globals, locals)  # execute the script
  File "/home/jb/Applications/pycharm-2019/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile
    exec(compile(contents+"\n", file, 'exec'), glob, loc)
  File "/home/jb/Dropbox/Workspace/keras-yolo3/scripts/train.py", line 206, in <module>
    _main(**arg_params)
  File "/home/jb/Dropbox/Workspace/keras-yolo3/scripts/train.py", line 175, in _main
    callbacks=[tb_logging, checkpoint])
  File "/home/jb/.local/lib/python3.6/site-packages/keras/legacy/interfaces.py", line 91, in wrapper
    return func(*args, **kwargs)
  File "/home/jb/.local/lib/python3.6/site-packages/keras/engine/training.py", line 1426, in fit_generator
    initial_epoch=initial_epoch)
  File "/home/jb/.local/lib/python3.6/site-packages/keras/engine/training_generator.py", line 211, in fit_generator
    max_queue_size=max_queue_size)
  File "/home/jb/.local/lib/python3.6/site-packages/keras/legacy/interfaces.py", line 91, in wrapper
    return func(*args, **kwargs)
  File "/home/jb/.local/lib/python3.6/site-packages/keras/engine/training.py", line 1480, in evaluate_generator
    verbose=verbose)
  File "/home/jb/.local/lib/python3.6/site-packages/keras/engine/training_generator.py", line 325, in evaluate_generator
    outs = model.test_on_batch(x, y, sample_weight=sample_weight)
  File "/home/jb/.local/lib/python3.6/site-packages/keras/engine/training.py", line 1255, in test_on_batch
    sample_weight=sample_weight)
  File "/home/jb/.local/lib/python3.6/site-packages/keras/engine/training.py", line 754, in _standardize_user_data
    exception_prefix='input')
  File "/home/jb/.local/lib/python3.6/site-packages/keras/engine/training_utils.py", line 126, in standardize_input_data
    'with shape ' + str(data_shape))
ValueError: Error when checking input: expected input_1 to have 4 dimensions, but got array with shape (1, 1)
Borda commented 5 years ago

found nasty the bug :imp: https://github.com/Borda/keras-yolo3/blob/e6598d13c703029b2686bc2eb8d5c09badf42992/yolo3/utils.py#L51

Borda commented 5 years ago

@KeKsBoTer it should be changed in this particular commit b46e258ae35cd0021c85fe9392fb7c7ecbe6dedb If you have anything else, pls, feel free to reopen it...