You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 11, 2026. It is now read-only.
OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Ubuntu 20.04
TensorFlow version and how it was installed (source or binary): 2.4.0, binary
TensorFlow-Addons version and how it was installed (source or binary): 0.14.0, binary
Python version: 3.8
Is GPU used? (yes/no): yes, DGX-2 = up to 16 V100.
Describe the bug
I'm trying to use F1Score as a metric for a semantic segmentation problem because I've read that it works by whole-batch aggregation and not by mini-batch aggregation like countless other implementations on the net do. Presumably, it also shouldn't depend on the batch size.
I've tried it in a custom loop as the validation metric for multi class problem with average=None to get separate F1 score per class. It worked reasonably well. When I tried to use it with MirroredStrategy, I got F1 > 1 for a majority class. In fact, the more gpus I use, the more value I get. Do we need to divide the result by num_replicas_in_sync?
System information
Describe the bug
I'm trying to use F1Score as a metric for a semantic segmentation problem because I've read that it works by whole-batch aggregation and not by mini-batch aggregation like countless other implementations on the net do. Presumably, it also shouldn't depend on the batch size.
I've tried it in a custom loop as the validation metric for multi class problem with average=None to get separate F1 score per class. It worked reasonably well. When I tried to use it with MirroredStrategy, I got F1 > 1 for a majority class. In fact, the more gpus I use, the more value I get. Do we need to divide the result by num_replicas_in_sync?
I'll try to provide a code example.