mirror of
https://github.com/openai/CLIP.git
synced 2026-11-05 01:37:26 +00:00
[GH-ISSUE #323] Getting overfitted CLIP model while fine-tuning with a large training dataset #278
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#278
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 @antu-saha on GitHub (Feb 18, 2023).
Original GitHub issue: https://github.com/openai/CLIP/issues/323
Hi,
I want to fine-tune the CLIP model with my dataset. The size of the dataset is very large. There are more than 2M image-text pairs. I tried various learning rates including too-small learning rates. But during training, the loss is decreasing at first and after 2 or 3 epochs the loss is increasing again. I am using SGD optimizer. If I use a subset of my full dataset (smaller dataset), then the training is going well.
As I have lots of captions for the same image (on average 110 captions for each image), I have created a dataset with a unique batch (all the image-text pairs are unique in the same batch). Due to memory constraints, I am using a batch size of 200. Still, I am getting the same training graph.
Could you please tell me why I am facing this issue? Is it because of my dataset size?
What should I do for getting better fine-tuning?
Thank you very much.
@Rohinivv96 commented on GitHub (Oct 27, 2023):
Hi @antu-saha Can you please guide me how we can fine tune CLIP model for custom dataset.
@BaochaoZhu commented on GitHub (Mar 11, 2024):
Hi @antu-saha Can you please guide me how we can fine tune CLIP model for custom dataset.
@antu-saha commented on GitHub (Mar 11, 2024):
Hi @Rohinivv96 and @BaochaoZhu, my apology for the late reply.
Sure, I can guide you to fine-tune CLIP.
We can fine-tune CLIP using the pretrained model. We just need to prepare our dataset. In my case, I have images with their corresponding captions. I created 2 lists (image paths and captions) and used those lists to create the batches. I can also share the code if needed. Please don't hesitate to reach out if you wanna know more information.
Thank you very much.
@BaochaoZhu commented on GitHub (Mar 12, 2024):
@antu-saha Thank you for your assistance. Would you mind sharing the code with me or emailing it to zhubaochao666888@gmail.com? I would like to learn from it. Thank you very much.
@anhuigzj commented on GitHub (Jan 3, 2025):
Would you mind sharing the code with me or emailing it to 1195688513@qq.com? I would like to learn from it. Thank you very much.
@PixelChen24 commented on GitHub (Nov 11, 2025):
笑死我了这哥们本来是提问题的,结果被一堆更加有问题的伸手党要代码了