Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply to custom datasets #7

Closed
Breeze-Zero opened this issue Oct 27, 2021 · 6 comments
Closed

Apply to custom datasets #7

Breeze-Zero opened this issue Oct 27, 2021 · 6 comments

Comments

@Breeze-Zero
Copy link

Thank you very much for your work. I have the idea of applying it to my own data set, but it is not friendly to laypeople. I don't know where to start

@Breeze-Zero
Copy link
Author

Breeze-Zero commented Oct 28, 2021

[10/28 14:26:37.942]: Test: [ 0/15] Time 3.620 (3.620) Loss 126.323 (126.323) Mem 23348
[10/28 14:26:44.515]: => synchronize...
Calculating mAP:
[10/28 14:26:44.641]: mAP: nan
[10/28 14:26:44.641]: aps: [92.26503 25.11109 8.59202 1.54282 0.4329 nan nan nan
nan nan nan nan nan]
[10/28 14:26:44.641]: => Test Epoch: [ 4/80] ETA 1:30:33 TT 0:01:11 (0:06:02) Loss 52.875 mAP nan Loss_ema 122.719 mAP_ema nan
[10/28 14:26:44.646]: 4 | Set best mAP nan in ep -1
[10/28 14:26:44.646]: | best regular mAP 0 in ep -1

There were many NAN after I manually adjusted the dataset

@SlongLiu
Copy link
Owner

  • How to apply it to other datasets?
    Just 1) change the parameter num_classes to the number of classes in your dataset of the transformer module in q2l and 2) load your data by modifying the dataset class in the code or defining your own class.
  • Nan in the output
    You can check if there is any nan in the model's output and try to find where nan first appears in the model. I've had this happen in training, but not in testing. It's helpful if you can provide more logs of your training.

@vivian27chen
Copy link

Have you solved this problem? I find this problem in my epoch 8 while training.
The loss is NaN and it breaks

@stellating
Copy link

I meet the same problem in epoch 8 while training. Anyone solved this problem?

@nullgogo
Copy link

验证集里标签不全的话,mAP会出现nan。
解决方法
(1)训练集和验证集划分的时候,保证验证集的标签完整;
(2)metric.py里在计算ap的时候,如果验证集里没有的标签,ap会是nan,所以最方便的方法是把ap为nan的过滤掉,在50行前面加上,
if ap != ap:
continue
通过上面两种方法都可以解决nan的问题,但更倾向于第一种方法。

@JiangdongWang123
Copy link

Have you solved this problem? I find this problem in my epoch 8 while training. The loss is NaN and it breaks

Have you solved the problem? I have the same problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants