Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem about ResNet. #134

Open
A-cunminF opened this issue Dec 3, 2021 · 0 comments
Open

Problem about ResNet. #134

A-cunminF opened this issue Dec 3, 2021 · 0 comments

Comments

@A-cunminF
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant