mirror of
https://github.com/openai/CLIP.git
synced 2026-11-05 01:37:26 +00:00
[GH-ISSUE #63] NAN in downstream detection finetuneing task #57
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
openai/CLIP#57
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @launchauto on GitHub (Mar 22, 2021).
Original GitHub issue: https://github.com/openai/CLIP/issues/63
I try to use you RN50.pt as a backbone in Faster-RCNN-coco-detection task in mmdetection arichtecture.
Firstly, I try to modified the layer name of RN50.pt and resaved them so that the parameters can be laoded correctly.
Then, I modified ResNetV1d to match your ModifiedResNet in clip model.
During the fineturning procedure, I do not use your attention layer and just use the output of reslayer4,reslayer3,reslayer2 reslayer1 to FPN.
@launchauto commented on GitHub (Mar 22, 2021):
During the training procedure the loss will be NAN right from the start
@jongwook commented on GitHub (Mar 22, 2021):
Did you try #40 ?
@launchauto commented on GitHub (Mar 22, 2021):
When I load your pretrained model and resave it I use
clip_r50_model=torch.jit.load('/data1/pretrained/model/clip/RN50.pt',map_location='cpu').eval()
Then I modified some layer names and resaved it.
After build model, I add model=model.float()
It still NAN right from the start.
Does it work?
@jongwook commented on GitHub (Mar 22, 2021):
The JIT code contains hard-coded dtype variables and will not work if you simply cast by calling
.float(); this was why I had to patch those variables in some hacky way to make it runnable on CPU.Use
clip.load()withjit=Falseto load the model in a non-JIT mode, and try again.@launchauto commented on GitHub (Mar 23, 2021):
Thx! I try jit=False and let the learning_rate to be 0.002 for 8GPU and warmup step =1000 batchsize=16(ImageNet supervision is 0.02 for batchsize=16). Hopefully this time I can get reasonable result.
@launchauto commented on GitHub (Mar 23, 2021):
This time it will not be NAN.
@launchauto commented on GitHub (Mar 23, 2021):
BTW, do you have some suggestion to learning rate and optimizer when transfer to detection model. Thx~
@jongwook commented on GitHub (Mar 23, 2021):
There's no universal rule on this, but I'd start with 10% the learning rate used for pre-training.
@launchauto commented on GitHub (Mar 23, 2021):
Thx. I will try.
@dragen1860 commented on GitHub (Apr 1, 2021):
@launchauto Hi, What's the mAP when you adopt the clip backbone? is it gain improment? I would like to here some suggestion from you . Thank you.
@Edwardmark commented on GitHub (Apr 12, 2021):
@launchauto Have you made any progress in detection using clip models?