I am attempting a regression task where my labels are continuous values. However, MMPretrain always converts them to integers. #1884
Unanswered
rainyNighti
asked this question in
Q&A
Replies: 2 comments
-
Did you solve this? |
Beta Was this translation helpful? Give feedback.
0 replies
-
Any hint or tutorial on how to do it? Many thanks! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
My labels are continuous values ranging from 1 to 10, such as 5.7. I have created a custom MyDataset(BaseDataset) that returns
{'img_path': 'path', 'gt_label': float num}
. However, after packaging the DataLoader with MMPretrain, the gt_label is converted to an integer.I'm trying to debug the mmengin.runner.build_dataloader function, specifically until line 1476:
Before this point, the dataset contains normal decimal values for the gt_label. However, after packaging it with DataLoader and obtaining the gt_label through batch_sampler, the values become integers. I suspect that the collate_fn might be performing the conversion, but I'm unable to further examine the definition of default_collate. Could you please advise me on how to keep the labels as decimal values or if MMPretrain supports decimal labels?
I have implemented a custom MyDataset, MSE loss, MSE evaluation metric, and used the resnet18_cifar model with the num_classes in the head set to 1. Here is a partial definition:
The MyDataset is defined as follows:
MSELoss:
Model Config:
Beta Was this translation helpful? Give feedback.
All reactions