AttributeError: модуль 'ea' не имеет атрибута 'Scalars' - TFLearn Image Classification - PullRequest
0 голосов
/ 12 февраля 2019

Я разрабатываю классификатор изображений с использованием tflearn и tenorflow.Я закончил с тренировкой моей модели, но теперь я должен построить график точности.Я попытался сделать это с помощью keras со следующим кодом:

history = model.fit({'input': X_train}, {'targets': y_train}, n_epoch=50,
      validation_set=({'input': X_test}, {'targets': y_test}),
      snapshot_step=1250, show_metric=True, run_id=MODEL_NAME)
# list all data in history
print(history.history.keys())
# summarize history for accuracy
plt.plot(history.history['acc'])
plt.plot(history.history['val_acc'])
plt.title('model accuracy')
plt.ylabel('accuracy')
plt.xlabel('epoch')
plt.legend(['train', 'test'], loc='upper left')
plt.show()

, но он выдал следующую ошибку:

AttributeError: NoneType Object has no attribute 'History'

Я попытался установить модуль истории, но он не работает и говорит:

could not find a version that satisfies the requirement history

тогда я попытался использовать tflearn для построения графика с помощью следующего кода:

hist = {
'Accuracy' : [x.value for x in ea.Scalars('Accuracy')],
'Validation Accuracy' : [x.value for x in         ea.Scalars('Accuracy/Validation')], 
'Loss' : [x.value for x in ea.Scalars('Loss')],
'Validation Loss' : [x.value for x in ea.Scalars     
('Loss/Validation')]
}

fig = plt.figure()
keys = ['Accuracy', 'Loss', 'Validation Accuracy', 'Validation Loss']
for i,thing in enumerate(keys):
    trace = hist[thing]
    plt.subplot(2,2,i+1)
    plt.plot(range(len(trace)), trace)
    plt.title(thing)

fig.set_tight_layout(True)
fig

, но также выдает ошибку, которая гласит:

AttributeError: module 'ea' has no attribute 'Scalars'

Если кто-то можетпомочь с любым из этих методов, будь то tflearn или keras, было бы здорово.
Спасибо.

...