-
Notifications
You must be signed in to change notification settings - Fork 15
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
On the bilinear in your implementation. #1
Comments
@tianzhi0549 Thanks for pointing out it, i will try and update the new result later. |
@Epiphqny I also note that it seems you are using absolute coordinates as the input to the mask heads, which is not correct. It is important to use relative coordinates here because we hope the generated filters are position-independent. |
@tianzhi0549 The coordinates in this implementation is ranged from -1 to 1, what do you mean by relative coordinates, should it be 0-1 instead? |
@Epiphqny aim-uofa/AdelaiDet#10. You can refer to the explanation here. |
@tianzhi0549 Ok, i will try that. |
@tianzhi0549 It sounds that the relative coordinates is in some way like the center-ness...but implements in different approach, just my opinion. |
@tianzhi0549 They may be similar in some aspects, but they are designed for totally different purposes ... |
@tianzhi0549 Yes, both are interesting ideas! |
@tianzhi0549 Hi, i replaced the original upsample with the aligned version and used the upsampled mask to calculate loss, now the AP is 37.1. But this is still the absolute coordinate version, i will update new results after the training of relative coordinate version finished. |
@Epiphqny Great! For the memory usage issue, you could limit the maximum number of samples used to compute masks during training. Using relative coordinates might also much boost the performance. |
@tianzhi0549 Perhaps there is some problem in my implementation of relative coordinates, it only achieves 36.9 mAP, which is worse than the absolute coordinate version. |
@Epiphqny if possible, you can push your code to a new branch of the repo. I can help check it. |
Hi @tianzhi0549, i have add the code in the relative_coordinate branch, thank you very much for the help! |
@Epiphqny Are you sure this line is correct? CondInst/fcos/modeling/fcos/fcos_outputs.py Line 591 in 1b03b70
|
@Epiphqny Hi~Thanks for sharing your code! CondInst/configs/CondInst/Base-FCOS.yaml Lines 17 to 18 in ea3f717
IMS_PER_BATCH and BASE_LR should be changed together according to Linear Scaling Rule, you need to set the learning rate proportional to the batch size if you use different GPUs or images per GPU, e.g., IMS_PER_BATCH = 4 & BASE_LR = 0.0025 .
I also find the similar problem in your YOLACT_FCOS repo: Though changing |
@Yuxin-CV Thank you very much for pointing out that, i will try the Linear Scaling Rule later. |
@tianzhi0549 sorry, can not find the problem in this line, could you point out it directly? |
@Epiphqny I would suggest that you compute all the coordinate transformation on the scale of the input image. After you get the final relative coordinates, you can normalize them by a constant scale. Please make sure even after normalization, the locations generating the filters should always be at (0, 0). |
@tianzhi0549 I have subtracted the center coordinate in CondInst/fcos/modeling/fcos/fcos_outputs.py Line 600 in 1b03b70
|
Personally, I think you can try R-50 1x lr_schedule with input_size = 800, batch_size = 16 first before using stronger backbone and longer lr_schedule. You can get the results in less than 1 day if you have access to 4 or 8 GPU. |
BTW, I wonder how you @tianzhi0549 implement the CondInst/fcos/modeling/fcos/fcos_outputs.py Lines 585 to 607 in ea3f717
or some other highly optimized implementation, e.g., a CUDA kernel? |
Hi~@Epiphqny CondInst/fcos/modeling/fcos/fcos_outputs.py Lines 581 to 582 in 4a519c1
I think it is better to use num_pos_avg as the normalization factor, which is the average of all the positive samples across different GPUs.CondInst/fcos/modeling/fcos/fcos_outputs.py Lines 504 to 508 in 4a519c1
|
@Epiphqny I think the rel. coord. should be location specific, just like:
@tianzhi0549 Am I right? Could you provide the official code snippet of rel. coord.? Thanks! |
@Yuxin-CV Please modify the code and train the model, then report the result here. I will update if there is improvement. I don't have extra GPU to train the model now. |
OK |
@Epiphqny For your information. aim-uofa/AdelaiDet#23 (comment). Thank you:-). |
@tianzhi0549 Ok, thanks for providing the code. |
@tianzhi0549 I got the same result in your docker using "aligned_bilinear" and "F.interpolate" ! |
@tianzhi0549 |
CondInst/fcos/modeling/fcos/fcos_outputs.py
Line 366 in 4a519c1
The default bilinear in PyTorch is not aligned, which might much degrade the performance, in particular for small objects.
Please try the aligned bilinear.
The text was updated successfully, but these errors were encountered: