Issue 1:
Illustration of root cause (mentioned in neighbour branch by @robertlugg).

Debug output is added to class methods:

class ProgbarLogger(Callback):
"""Callback that prints metrics to stdout.

# Arguments
count_mode: One of "steps" or "samples".
Whether the progress bar should
count samples seen or steps (batches) seen.
stateful_metrics: Iterable of string names of metrics that
should *not* be averaged over an epoch.
Metrics in this list will be logged as-is.
All others will be averaged over time (e.g. loss, etc).

# Raises
ValueError: In case of invalid `count_mode`.
"""

def __init__(self, count_mode='samples',
stateful_metrics=None):
super(ProgbarLogger, self).__init__()
if count_mode == 'samples':
self.use_steps = False
elif count_mode == 'steps':
self.use_steps = True
else:
raise ValueError('Unknown `count_mode`: ' + str(count_mode))
if stateful_metrics:
self.stateful_metrics = set(stateful_metrics)
else:
self.stateful_metrics = set()

def on_train_begin(self, logs=None):
print('train begin')
self.verbose = self.params['verbose']
self.epochs = self.params['epochs']

def on_epoch_begin(self, epoch, logs=None):
print('epoch begin')
if self.verbose:
print('Epoch %d/%d' % (epoch + 1, self.epochs))
if self.use_steps:
target = self.params['steps']
else:
target = self.params['samples']
print('Progbar initialization (target property is initially assigned here)')
self.target = target
self.progbar = Progbar(target=self.target,
verbose=self.verbose,
stateful_metrics=self.stateful_metrics)
self.seen = 0

def on_batch_begin(self, batch, logs=None):
print('batch begin')
if self.seen < self.target:
self.log_values = []

def on_batch_end(self, batch, logs=None):
print('batch end')
logs = logs or {}
batch_size = logs.get('size', 0)
if self.use_steps:
self.seen += 1
else:
self.seen += batch_size

for k in self.params['metrics']:
if k in logs:
self.log_values.append((k, logs[k]))

# Skip progbar update for the last batch;
# will be handled by on_epoch_end.
if self.verbose and self.seen < self.target:
self.progbar.update(self.seen, self.log_values)

def on_epoch_end(self, epoch, logs=None):
print('epoch end')
logs = logs or {}
for k in self.params['metrics']:
if k in logs:
self.log_values.append((k, logs[k]))
if self.verbose:
self.progbar.update(self.seen, self.log_values)

Caller code example:

model.fit(
np.ndarray(shape=(13, 2,)),
np.ndarray(shape=(13, 2,)),
batch_size=batch_size,
validation_data=(
np.ndarray(shape=(13, 2)),
np.ndarray(shape=(13, 2)),
),
callbacks=[callbacks.ProgbarLogger(count_mode='samples')],
epochs=13,
verbose=0) # <<<

Output for initialisation and training start scenario in silent mode

train begin
epoch begin
batch begin
Traceback (most recent call last):
File "train_cli.py", line 398, in <module>
start_training()
File "train_cli.py", line 349, in start_training
initial_epoch=initial_epoch,
File "train_cli.py", line 234, in fit_model_softmax
history_viz_cb,
File "/Users/ilyakutukov/anaconda3/envs/jenv/lib/python3.6/site-packages/keras/engine/training.py", line 1039, in fit
validation_steps=validation_steps)
File "/Users/ilyakutukov/anaconda3/envs/jenv/lib/python3.6/site-packages/keras/engine/training_arrays.py", line 195, in fit_loop
callbacks.on_batch_begin(batch_index, batch_logs)
File "/Users/ilyakutukov/anaconda3/envs/jenv/lib/python3.6/site-packages/keras/callbacks.py", line 91, in on_batch_begin
callback.on_batch_begin(batch, logs)
File "/Users/ilyakutukov/anaconda3/envs/jenv/lib/python3.6/site-packages/keras/callbacks.py", line 316, in on_batch_begin
if self.seen < self.target:
AttributeError: 'ProgbarLogger' object has no attribute 'target'

This bug is related to:

AttributeError: 'ProgbarLogger' object has no attribute 'log_values' #8944

AttributeError: 'ProgbarLogger' object has no attribute 'log_values' #3657 (duplicate)

Please make sure that the boxes below are checked before you submit your issue. If your issue is an implementation question, please ask your question on StackOverflow or join the Keras Slack channel and ask there instead of filing a GitHub issue.

Thank you!

Check that you are up-to-date with the master branch of Keras. You can update with:

pip install git+git://github.com/keras-team/keras.git --upgrade --no-deps

If running on TensorFlow, check that you are up-to-date with the latest version. The installation instructions can be found here.

If running on Theano, check that you are up-to-date with the master branch of Theano. You can update with:

pip install git+git://github.com/Theano/Theano.git --upgrade --no-deps

Provide a link to a GitHub Gist of a Python script that can reproduce your issue (or just copy the script here if it is short). (patch with test coverage is provided)

Issue 2:
fit_generator.

It does work in:

Python 3.6.5

Keras 2.1.6

But doesn't in:

Python 3.6.8

Keras 2.2.4

Unless related to version of other modules.