logo
Loading...

出現NoneType' object is not subscriptable錯誤 - Cupoy

TypeError                                 Tracebac...

ml100-3,ml100-3-d88

出現NoneType' object is not subscriptable錯誤

2019/12/07 03:52 AM
機器學習新手論壇
骑士
觀看數:0
回答數:2
收藏數:0
ml100-3
ml100-3-d88



TypeError                                 Traceback (most recent call last)
<ipython-input-8-de2a5ca0ea56> in <module>
     9           validation_data=(x_test, y_test),
    10           shuffle=True,
---> 11           callbacks=[log_f1sc]
    12          )
    13 


....


16     def on_epoch_end(self, epoch, logs = {}, thres=0.5):
    17         logs = logs or {}
---> 18         y_true = self.validation_data[1].argmax(axis = 1)
    19         y_pred = self.model.predict(self.validation_data[0])
    20         y_pred = (y_pred[:, 1] >= thres) * 1

TypeError: 'NoneType' object is not subscriptable


备注:我是调用tensorflow.keras函数库。