haotian-liu / LLaVA

[NeurIPS'23 Oral] Visual Instruction Tuning (LLaVA) built towards GPT-4V level capabilities and beyond.
https://llava.hliu.cc
Apache License 2.0
19.54k stars 2.15k forks source link

[Question] No matter what I ask, my model always gives the same answer. #1546

Open zy1996829 opened 3 months ago

zy1996829 commented 3 months ago

Question

I used LLAVA-V1.5-13b to fine-tune my own dataset, which consists of around 20,000 images. However, these 20,000 images are relatively homogeneous, with only two categories, such as driving while using a phone and driving while drowsy. Then, I used GBT to generate dialogue labels for each image, for example: Human: "Is there any violation of driving behavior in the image?" GBT: "Yes, there is a violation. The driver is using a phone while driving." After one epoch of fine-tuning, the loss decreased to around 0.3. During testing, the model can recognize behaviors like using a phone or being drowsy. However, regardless of the question I ask about a specific image, the model always gives the same answer. I asked if there is any violation in this image:

CGX01BASXJ27DAAEEB39_39 mp4_3_110 The answer: WXWorkCapture_17176457449106

Howerer,when I say Hello,the result is the same answer: WXWorkCapture_171766454522 This is my train config: deepspeed /home/zhouyan/LLaVA-1.2.2/llava/train/train_mem.py \ --deepspeed ./scripts/zero3.json \ --model_name_or_path /home/zhouyan/LLaVA-main/checkpoints/llava-v1.5-13b \ --version v1 \ --data_path /home/zhouyan/LLaVA-main/data/driver_action.json \ --image_folder /home/zhouyan/cabin_oms_gt_frames/ \ --vision_tower /home/zhouyan/LLaVA-main/openai/clip-vit-large-patch14-336 \ --mm_projector_type mlp2x_gelu \ --mm_vision_select_layer -2 \ --mm_use_im_start_end False \ --mm_use_im_patch_token False \ --image_aspect_ratio pad \ --group_by_modality_length True \ --bf16 True \ --output_dir ./checkpoints/llava-v1.5-13b-task_finetune \ --num_train_epochs 1 \ --per_device_train_batch_size 4 \ --per_device_eval_batch_size 4 \ --gradient_accumulation_steps 1 \ --evaluation_strategy "no" \ --save_strategy "steps" \ --save_steps 50000 \ --save_total_limit 1 \ --learning_rate 2e-5 \ --weight_decay 0. \ --warmup_ratio 0.03 \ --lr_scheduler_type "cosine" \ --logging_steps 1 \ --tf32 True \ --model_max_length 2048 \ --gradient_checkpointing True \ --dataloader_num_workers 4 \ --lazy_preprocess True \

my train loss curve: W B Chart 6_6_2024, 5_53_15 PM

nlpkiddo-2001 commented 3 months ago

Hi, I am also exactly having the same issue and my loss hovers around 0.5 - 0.7. I experienced in both pre training of projector and fine tuning of gemma decoder and projector.

Any updates??

PoopBear1 commented 3 months ago

I have the same issue, yet I did not fine-tune any thing. I directly use the pre-train checkpoints #1578.

hrishikesh-st commented 3 months ago

Hi, I am facing the exact same issue. The model seems to overfit on the dataset. Within first 20% of the first epoch the training seems the loss seems to be stable around 0.5-0.7. Any update will be really appreciated. I am using the LLAVA-V1.5-7b model.

nlpkiddo-2001 commented 2 months ago

@hrishikesh-st could you share me your code to load and infer the models? I rectified this issue, by not giving base model param while infering

hrishikesh-st commented 2 months ago

@nlpkiddo-2001 I am using the Gradio Web UI stated in the README for loading and inferring the model. Can you please eloborate more on "not giving base model param while infering"? Thanks