Skip to content

Models give same age and gender for different images #82

Description

@jvdrag

Using the pre-trained model available in this repository got me to this:

Loading dataset: HuggingFaceM4/FairFace config: 0.25
/usr/local/envs/myenv/lib/python3.7/site-packages/datasets/load.py:1763: FutureWarning: 'ignore_verifications' was deprecated in favor of 'verification_mode' in version 2.9.1 and will be removed in 3.0.0.
You can remove this warning by passing 'verification_mode=no_checks' instead.
FutureWarning,
Found cached dataset parquet (/root/.cache/huggingface/datasets/HuggingFaceM4___parquet/0.25-1a13370f29aa8c70/0.0.0/14a00e99c0d15a23649d0db8944380ac81082d4b021f398733dd84f3a6c569a7)
100% 2/2 [00:00<00:00, 218.18it/s]
Dataset loaded successfully.
Dataset({
features: ['image', 'age', 'gender'],
num_rows: 173488
})
Building model (using build_net3 from C3AE_expand.py architecture)...

Model: "C3AE_Expand_Net"

Weights loaded successfully.
!!!!! Found NaN in weights, replacing with 0.
Layer sample (first few elements): [-0.4407964 -0.01276569 0.31867692 -0.36723265 0.09467949]
!!!!! Found NaN in weights, replacing with 0.
Layer sample (first few elements): [0.95068 2.0552835 1.1609683 0.68024117 1.2869499 ]
!!!!! Found NaN in weights, replacing with 0.
Layer sample (first few elements): [-0.9160388 -1.0657301 -1.5303322 -0.6400793 -0.7105152]
!!!!! Found NaN in weights, replacing with 0.
Layer sample (first few elements): [-217.23065 -214.79196 -6.020306 487.3062 -47.080265]
!!!!! Found NaN in weights, replacing with 0.
Layer sample (first few elements): [46061.426 46790.33 1892.5228 98859.266 22331.162 ]
--- Weights refreshed (NaNs replaced with 0) ---

--- Creating Intermediate Models for Debugging ---
Intermediate models created.

Processing 100 examples...
Processing example 1/100

--- Intermediate Activation Check (Example 0) ---
Base Model Output (v1) - Shape: (1, 512), Mean: -1.8121, Std: 6.1161
Normalized cfeat Output - Shape: (1, 512), Mean: -0.0030, Std: 0.0441

--- Intermediate Activation Check (Example 1) ---
Base Model Output (v1) - Shape: (1, 512), Mean: -1.8121, Std: 6.1163
Normalized cfeat Output - Shape: (1, 512), Mean: -0.0030, Std: 0.0441

--- Intermediate Activation Check (Example 2) ---
Base Model Output (v1) - Shape: (1, 512), Mean: -1.8121, Std: 6.1164
Normalized cfeat Output - Shape: (1, 512), Mean: -0.0030, Std: 0.0441

Processing example 51/100
Finished processing. 100 examples successfully processed.

--- Prediction Results Sample (First 15) ---
original_age_label original_age_range original_gender predicted_age
0 6 50-59 Male -0.700401
1 4 30-39 Female -0.700441
2 1 3-9 Female -0.700463
3 3 20-29 Female -0.700420
4 3 20-29 Female -0.700464
5 3 20-29 Male -0.700429
6 5 40-49 Male -0.700477
7 4 30-39 Female -0.700402
8 2 10-19 Male -0.700436
9 4 30-39 Male -0.700414
10 6 50-59 Male -0.700444
11 3 20-29 Male -0.700460
12 3 20-29 Male -0.700452
13 2 10-19 Male -0.700386
14 7 60-69 Female -0.700453

predicted_gender
0 Male
1 Male
2 Male
3 Male
4 Male
5 Male
6 Male
7 Male
8 Male
9 Male
10 Male
11 Male
12 Male
13 Male
14 Male

Age prediction correct within range: 0/100 (0.00%)
Gender prediction correct: 48/100 (48.00%)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions