-
Notifications
You must be signed in to change notification settings - Fork 556
Description
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.