DeepLearningwithPython
DeepLearningwithPython copied to clipboard
3.5-classifying-movie-reviews.ipynb 執行時會遇到 KeyError: 'acc', 'val_acc'
原書ch3 在 github 中的 3.5-classifying-movie-reviews.ipynb 中執行到:
import matplotlib.pyplot as plt acc = history.history['acc'] val_acc = history.history['val_acc']
時會遇到兩個: KeyError: 'acc' KeyError: 'val_acc'
需修改爲: acc = history.history['binary_accuracy'] val_acc = history.history['val_binary_accuracy']
原作書中(和github)討論 以及與Ren和今天導讀Katy討論時都有間接提到:在"Building our network"的後半部分 跑model.compile()時 若避免選用最後一(第三)種方法的話 可以規避這個問題
我照著指示修改 KeyError: 'binary_accuracy'