C1M4_Assignment std and mean

I have 0/10 for 1 task but all other are 10/10. First task says

Failed test case: Normalize found in train_transformations, but with incorrect mean and/or std.
Expected: (mean=mean, std=std)
Got: (mean=(0.5071, 0.4867, 0.4408), std=(0.2675, 0.2565, 0.2761))

Failed test case: Normalize found in val_transformations, but with incorrect mean and/or std.
Expected: (mean=mean, std=std)
Got: (mean=(0.5071, 0.4867, 0.4408), std=(0.2675, 0.2565, 0.2761))


----------------

--- Verifying define_transformations ---

Training Transformations:
Compose(
    RandomHorizontalFlip(p=0.5)
    RandomVerticalFlip(p=0.5)
    RandomRotation(degrees=[-15.0, 15.0], interpolation=nearest, expand=False, fill=0)
    ToTensor()
    Normalize(mean=(0.5071, 0.4867, 0.4408), std=(0.2675, 0.2565, 0.2761))
)
------------------------------

Validation Transformations:
Compose(
    ToTensor()
    Normalize(mean=(0.5071, 0.4867, 0.4408), std=(0.2675, 0.2565, 0.2761))
)
Expected Output:
Training Transformations:
Compose(
    RandomHorizontalFlip(p=0.5)
    RandomVerticalFlip(p=0.5)
    RandomRotation(degrees=[-15.0, 15.0], interpolation=nearest, expand=False, fill=0)
    ToTensor()
    Normalize(mean=(0.5071, 0.4867, 0.4408), std=(0.2675, 0.2565, 0.2761))
)
------------------------------

Validation Transformations:
Compose(
    ToTensor()
    Normalize(mean=(0.5071, 0.4867, 0.4408), std=(0.2675, 0.2565, 0.2761))
)

What's wrong with those computers?

Sorry last task also 0/10 but in Notebook it looks fine:

--- Verifying validate_epoch ---

Validating on 640 images:

Returned Validation Loss: 2.7064
Returned Validation Accuracy: 6.72%


Return Types Check:	Function returned a float for loss and accuracy.
Weight Integrity Check:	Model weights were not changed during validation.

Expected Output:

Return Types Check:	Function returned a float for loss and accuracy.
Weight Integrity Check:	Model weights were not changed during validation.

Test your code!

unittests.exercise_5(validate_epoch)

 All tests passed!

the implementation to normalisation should be

transforms.Normalize(mean=mean, std=std)

Your error output mentions you have mentioned as (mean and/or std) which is incorrect in both places train_transformation and val_transformation

2 Likes

Thanks!

1 Like