tensoboard
导入:导入包注意
否者会报错 :keras FailedPreconditionError: Attempting to use uninitialized value training/Adam/Variable_9
真的是翻了一天,发现居然导入包区别会报这种错,sad
from tensorflow.keras.models import Sequential from tensorflow.keras.layers import Dense, Dropout, Embedding, LSTM, Bidirectional
load_model h5格式model
报 TypeError: tuple indices must be integers or slices, not list 错
需注意导入包是 tensorflow.keras 还是直接由keras直接导入
sad
load_model 时,存在自定义的loss或layer时
new_model = load_model(r'model.h5', custom_objects={'loss': loss})