lizzy8587 / CastDet

Code repo for "Toward Open Vocabulary Aerial Object Detection with CLIP-Activated Student-Teacher Learning" (ECCV2024)
12 stars 0 forks source link

## merge weights #3

Open douling843 opened 1 month ago

douling843 commented 1 month ago

python tools/merge_weights.py --clip_path --base_path --save_path --base_model <soft-teacher (default) | faster-rcnn>

Hello author, this is a great job. Can you provide a complete example?

LKXHZD commented 1 week ago

Hello author.I would also like an example.For example,where can I find clip_path and base_model_path.Please forgive my ignorance,as I am a novice just starting out.

JaggerGu commented 1 week ago

i am encountering the same problem :)

LKXHZD commented 1 week ago

I have solved this problem,but the detection rate is very low.This is a code example: python tools/merge_weights.py --clip_path RemoteCLIP-RN50.pt --base_path iter_80000.pth --save_path checkpoint --base_model soft-teacher

JaggerGu commented 1 week ago

I have solved this problem,but the detection rate is very low.This is a code example: python tools/merge_weights.py --clip_path RemoteCLIP-RN50.pt --base_path iter_80000.pth --save_path checkpoint --base_model soft-teacher

I met some problem when I run it, can you help me to solve it? thanks and best regards Traceback (most recent call last): File "tools/merge_weights.py", line 43, in <module> main() File "tools/merge_weights.py", line 40, in main merge_weights(args.clip_path, args.base_path, args.save_path, args.base_model) File "tools/merge_weights.py", line 15, in merge_weights clip = torch.load(clip_path).state_dict() AttributeError: 'dict' object has no attribute 'state_dict'

JaggerGu commented 6 days ago

I have solved this problem,but the detection rate is very low.This is a code example: python tools/merge_weights.py --clip_path RemoteCLIP-RN50.pt --base_path iter_80000.pth --save_path checkpoint --base_model soft-teacher

I met some problem when I run it, can you help me to solve it? thanks and best regards Traceback (most recent call last): File "tools/merge_weights.py", line 43, in <module> main() File "tools/merge_weights.py", line 40, in main merge_weights(args.clip_path, args.base_path, args.save_path, args.base_model) File "tools/merge_weights.py", line 15, in merge_weights clip = torch.load(clip_path).state_dict() AttributeError: 'dict' object has no attribute 'state_dict'

Solved. I deleted the state_dict()

douling843 commented 3 days ago

I have solved this problem,but the detection rate is very low.This is a code example: python tools/merge_weights.py --clip_path RemoteCLIP-RN50.pt --base_path iter_80000.pth --save_path checkpoint --base_model soft-teacher

I met some problem when I run it, can you help me to solve it? thanks and best regards Traceback (most recent call last): File "tools/merge_weights.py", line 43, in <module> main() File "tools/merge_weights.py", line 40, in main merge_weights(args.clip_path, args.base_path, args.save_path, args.base_model) File "tools/merge_weights.py", line 15, in merge_weights clip = torch.load(clip_path).state_dict() AttributeError: 'dict' object has no attribute 'state_dict'

Solved. I deleted the state_dict()

When I run python tools/train.py configs/visdrone_step2_castdet_12b_10k.py, I got the following error, please, how can I solve it?

FileNotFoundError: checkpoints/exp42_iter_76000_remote_clip.pth can not be found. Successfully save queue in work_dirs/visdrone_step2_castdet_12b_10k/0_save_queue_samples.npz

LKXHZD commented 3 days ago

There is a path in the last line of the file"visdrone_step2_castdet_12b_10k.py",modify it to the path of the *.pth generated in your previous run.

lizzy8587 commented 1 day ago

I have solved this problem,but the detection rate is very low.This is a code example: python tools/merge_weights.py --clip_path RemoteCLIP-RN50.pt --base_path iter_80000.pth --save_path checkpoint --base_model soft-teacher

Thank you, that's correct. I'll update the code later. If you need more help with the detection rate, I could offer some help. Are there any hyperparameters changed (e.g. training schedule, optimizer, threshold, batch size, etc.)?

LKXHZD commented 1 day ago

Firstly I change the batch size,then an error occurred.To this end,I change the learning rate policy(e.g. connect the intervals of method LinearLR and method MultiStepL) during the pre training phase.Although this solves the error,the detection rate is only about 15%.May I ask why this is happening and how to solve it?

lizzy8587 commented 1 day ago

Firstly I change the batch size,then an error occurred.To this end,I change the learning rate policy(e.g. connect the intervals of method LinearLR and method MultiStepL) during the pre training phase.Although this solves the error,the detection rate is only about 15%.May I ask why this is happening and how to solve it?

Have you considered trying the original batch size? Someone told me earlier that the batch size can affect the results.

LKXHZD commented 1 day ago

OK,I will try the original batch size.Thank you.