bstriner / keras-tqdm

Keras integration with TQDM progress bars
MIT License
348 stars 41 forks source link

Support Keras 2.0 variable names #8

Closed bnaul closed 7 years ago

bnaul commented 7 years ago

nb_epoch and nb_sample were changed to epochs and samples, respectively; this is backwards-compatible and will check for both versions.

bstriner commented 7 years ago

Thanks @bnaul ! Just spent all night making keras v2 fixes in keras-rl. Going to be a pain on a lot of different projects.

Just changed the progress bar from counting batches to counting samples, which seems to make more sense. Unfortunately, now need to resolve conflicts on this branch. Would be great if you could update for the new version, otherwise I'll take a swing at it maybe next week.

Cheers

bnaul commented 7 years ago

Hm...I'm afraid making that change (batches -> samples) may have been a mistake. From the Keras 2.0 release notes:

The methods fit_generator, evaluate_generator and predict_generator now work by drawing a number of batches from a generator (number of training steps), rather than a number of samples.

So batch count (or step count) is still the quantity we want to track.

bnaul commented 7 years ago

The version I just pushed works with fit on keras==1.2.2 and 2.0.0, and with fit_generator on 2.0.0 but not 1.2.2; I'm not sure how difficult it'd be to get both working but also not sure if it's a priority?

bstriner commented 7 years ago

@bnaul thanks for the help! Made a few changes so current version uses samples for keras 1 fit and fit_generator and keras 2 fit. It uses batches as the fallback for keras 2 fit_generator. Also, I setup Travis so it will be easy to check that everything works on keras 1 and 2 and python 2.7 and 3.5.

Cheers