代码:
import numpy as np
import tensorflow as tf
import tensorflow_addons as tfa
x = np.random.random((5,1,5))
y = np.random.random((5,1,5))
inputs = tf.keras.layers.Input(shape=(3,))
outputs = tf.keras.layers.Dense(2, name="out_1")(inputs)
model = tf.keras.models.Model(inputs=inputs, outputs=outputs)
model.compile(optimizer="Adam", loss="mse", metrics=["acc"])
pg = tfa.callbacks.TQDMProgressBar()
model_callbacks = [pg, ]
VERBOSE=0
history = model.fit(
x,
y,
epochs=100,
verbose=VERBOSE,
callbacks=model_callbacks
)
错误提示
在colab上会报错:
--------------------------------------------------------------