我正在使用 keras 并尝试使用张量板绘制日志。波纹管您可以找出我收到的错误以及我正在使用的软件包版本列表。我无法理解它给了我“顺序”对象没有属性“_get_distribution_strategy”的错误。
包:Keras 2.3.1 Keras-Applications 1.0.8 Keras-Preprocessing 1.1.0 tensorboard 2.1.0 tensorflow 2.1.0 tensorflow-estimator 2.1.0
模型:
model = Sequential()
model.add(Embedding(MAX_NB_WORDS, EMBEDDING_DIM, input_shape=(X.shape[1],)))
model.add(GlobalAveragePooling1D())
#model.add(Dense(10, activation='sigmoid'))
model.add(Dense(len(CATEGORIES), activation='softmax'))
model.summary()
#opt = 'adam' # Here we can choose a certain optimizer for our model
opt = 'rmsprop'
model.compile(loss='categorical_crossentropy', optimizer=opt, metrics=['accuracy']) # Here we choose the loss function, input our optimizer choice, and set our metrics.
# Create a TensorBoard instance with the path to the logs directory
tensorboard = TensorBoard(log_dir='logs/{}'.format(time()),
histogram_freq = …Run Code Online (Sandbox Code Playgroud)