Meet a problem when applying model by compile-build-fit route.
In 'resent.py' ,row 112:
out = tf.reshape(out, (out.shape[0], -1))
By using out.shape, it will return a tuple rather than a tensor, which will be a problem when training the model by the 'model.fit' method.
Although it can be fine when setting run_fucntions_eagerly as True or just using Gradient Tape as in the 'main.py', it will cause unnecessary extra time when training.
It can be fixed when using Keras.layers.Faltten() or out = tf.reshape(out, (tf.shape(out)[0], -1)) instead. About 25% faster in my computer.
Meet a problem when applying model by compile-build-fit route.
In 'resent.py' ,row 112: out = tf.reshape(out, (out.shape[0], -1))
By using out.shape, it will return a tuple rather than a tensor, which will be a problem when training the model by the 'model.fit' method. Although it can be fine when setting run_fucntions_eagerly as True or just using Gradient Tape as in the 'main.py', it will cause unnecessary extra time when training.
It can be fixed when using Keras.layers.Faltten() or out = tf.reshape(out, (tf.shape(out)[0], -1)) instead. About 25% faster in my computer.