我是keras初学者
Epoch 9/100
99/100 [============================>.] - ETA: 0s - loss: 0.4229 - acc: 0.8649Epoch 00008: val_loss did not improve
100/100 [==============================] - 72s - loss: 0.4222 - acc: 0.8650 - val_loss: 1.2091 - val_acc: 0.5000
Traceback (most recent call last):
File "Train.py", line 382, in <module>
train(args)
File "Train.py", line 351, in train
scores = model.evaluate_generator(validation_generator, workers=5, steps = None)
File "/home/Grace/kerasenv/local/lib/python2.7/site-packages/keras/legacy/interfaces.py", line 87, in wrapper
return func(*args, **kwargs)
File "/home/Grace/kerasenv/local/lib/python2.7/site-packages/keras/engine/training.py", line 1991, in evaluate_generator
if not isinstance(outs, list):
UnboundLocalError: local variable 'outs' referenced before assignment
我的代码在这里。
scores = model.evaluate_generator(validation_generator, workers=5, steps = None)
history_ft = model.fit_generator(
train_generator,
epochs=nb_epoch,
steps_per_epoch=steps_per_epoch,
validation_steps = 3,
validation_data=validation_generator,
callbacks = [tensorboard, checkpointer, EarlyStopping(monitor='val_loss', min_delta=0.01, patience=5)],
class_weight = 'auto',
workers = 5,
use_multiprocessing = True)
批量大小:8
我的keras 2.0.6版本
有人知道为什么吗?谢谢