can it work under tf 2.x? #26
lg2578
started this conversation in
Show and tell
Replies: 1 comment
-
with a random seed =3, I run the fashion-mnist demo,the ruslt is: Model without gctf: 28.0661 0.886354 0.310736 tf version is 2.5.1 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
1.get_gradients only support in tf 1 lengcy graph mode ,the code seems can't work under tf 2.x
2.I've runned the fashion-mnist demo, the model's compile method not init the model's weight, so may need to create model again before run the gctf.
like the following italic code:
import gctf #import gctf
time_callback_gctf = TimeHistory()
model = tf.keras.models.Sequential([
tf.keras.layers.Flatten(),
tf.keras.layers.Dense(512, activation=tf.nn.relu),
tf.keras.layers.Dense(256, activation=tf.nn.relu),
tf.keras.layers.Dense(64, activation=tf.nn.relu),
tf.keras.layers.Dense(512, activation=tf.nn.relu),
tf.keras.layers.Dense(256, activation=tf.nn.relu),
tf.keras.layers.Dense(64, activation=tf.nn.relu),
tf.keras.layers.Dense(10, activation=tf.nn.softmax)])
model.compile(optimizer = gctf.optimizers.adam(),
loss = 'sparse_categorical_crossentropy',
metrics=['acc'])
Beta Was this translation helpful? Give feedback.
All reactions