Skip to content

Solving Loss Saturation #150

@avernal1819

Description

@avernal1819

Issue: Loss stabilizes at a fixed value after certain training iterations.

Tried but unsuccessful solutions:

-Adjusting learning rate (lr)
-Changing batch size
-Switching model to different architectures from timm (ResNet, EfficientNet, etc.)
-Adding dropout
-Modifying temperature

Root Cause: opt.data_folder structure:
train
├── class1
├── class2
...
val
├── class1
├── class2
...
test
├── class1
├── class2

Initial code (incorrect path):
elif opt.dataset == 'path':
train_dataset = datasets.ImageFolder(root=opt.data_folder,
transform=TwoCropTransform(train_transform))

Corrected code (path explicitly set to 'train' folder):
train_dataset = datasets.ImageFolder(root=os.path.join(opt.data_folder, 'train'),
transform=TwoCropTransform(train_transform))

I mistakenly assumed that providing the general path to opt.data_folder would suffice, but the model was not loading the data correctly.

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