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

Reported FLOPS metric incorrect for ConvNeXtSmall model #6

Open
isaacgerg opened this issue Jun 8, 2023 · 0 comments
Open

Reported FLOPS metric incorrect for ConvNeXtSmall model #6

isaacgerg opened this issue Jun 8, 2023 · 0 comments

Comments

@isaacgerg
Copy link

isaacgerg commented Jun 8, 2023

The following code reports zero FLOPs which is incorrect.

import model_profiler
import tensorflow as tf
input_image = tf.keras.layers.Input(shape=(256, 256, 1))
rgb_layer = tf.keras.layers.concatenate([input_image, input_image, input_image]) * 255.0
ots = tf.keras.applications.ConvNeXtSmall(include_top=False, input_shape = (256, 256, 3), include_preprocessing=True, weights = init_weights)
fv = ots(rgb_layer)
f = tf.keras.layers.GlobalAveragePooling2D()(fv)
y_pred = tf.keras.layers.Dense(1, activation='sigmoid', name='output_class')(f)
model = tf.keras.models.Model(input_image, y_pred)
r = model_profiler.model_profiler(model, 1,  use_units = ['GPU IDs', 'MFLOPs', 'GB', 'Million', 'MB'])
print(r)

The above code prints:

| Model Profile                    | Value      | Unit    |
|----------------------------------|------------|---------|
| Selected GPUs                    | ['0', '1'] | GPU IDs |
| No. of FLOPs                     | 0.0        | MFLOPs  |
| GPU Memory Requirement           | 0.048      | GB      |
| Model Parameters                 | 49.4555    | Million |
| Memory Required by Model Weights | 188.6576   | MB      |

which is incorrect for the No. of FLOPs row.

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