ShowUI icon indicating copy to clipboard operation
ShowUI copied to clipboard

KeyError: 'patch_assign' while Running Training for Navigation Task

Open Yume-Ke opened this issue 1 year ago • 5 comments

Thank you very much for open-sourcing such an excellent project! I encountered an issue while debugging the Training process for the Navigation task, and I'm temporarily unable to resolve it. Therefore, I would like to ask for your help. Here's a detailed description of the issue: I followed the instructions provided in your TRAIN.md file. When executing the Navigation task, I encountered the following error:

Traceback (most recent call last):
  File "/home/shek/Projects/ShowUI/train.py", line 631, in <module>
    main(sys.argv[1:])
  File "/home/shek/Projects/ShowUI/train.py", line 599, in main
    score = validate(val_loader, model_engine, processor, epoch, global_step, writer, args)
  File "/home/shek/anaconda3/envs/showui/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "/home/shek/Projects/ShowUI/main/eval_aitw.py", line 119, in validate_aitw
    forward_dict.update(patch_assign=input_dict["patch_assign"])
KeyError: 'patch_assign'

And here are the commands I executed:

deepspeed --include localhost:1 --master_port 5678 train.py \
  --wandb_key='***' \
  --model_id='Qwen/Qwen2-VL-2B-Instruct' \
  --version='Qwen/Qwen2-VL-2B-Instruct' \
  --dataset_dir='/mnt/nvme1/Datasets/ShowUI' \
  --log_base_dir='~/Projects/ShowUI/training_log' \
  --epochs=50 \
  --steps_per_epoch=100 \
  --batch_size=1 \
  --grad_accumulation_steps=2 \
  --model_max_length=8192 \
  --exp_id="debug" \
  --train_ratio="1,1,1"  \
  --train_dataset="guiact,guiact,guiact"  \
  --train_json="hf_train_smartphone,hf_train_web-multi,hf_train_web-single"   \
  --val_dataset="aitw"  \
  --val_json="hf_test"    \
  --precision="bf16" \
  --attn_imple="sdpa" \
  --workers=32 \
  --lora_r=32 \
  --lora_alpha=64  \
  --min_visual_tokens=256  \
  --max_visual_tokens=1344  \
  --num_turn=100 \
  --random_sample \
  --record_sample \
  --lr=0.0001 \
  --uniform_prompt  \
  --ds_zero="zero2" \
  --gradient_checkpointing  \
  --lm_skip_ratio=0.5   \
  --lm_skip_layer='[1,28,0]'    \
  --num_history=2    \
  --interleaved_history='tttt'

More context about the error is shown in the attached image. Initially, I suspected the issue was related to preprocessing the AITW dataset. Thus, I reprocessed the dataset according to the provided guidelines. Unfortunately, the error persists.

Additionally, is your WeChat Group still open? I would greatly appreciate the opportunity to participate in discussions. Thank you!

Image Image

Yume-Ke avatar Apr 06 '25 06:04 Yume-Ke

I encountered the same issue on my end.

ThreeSR avatar Apr 06 '25 20:04 ThreeSR

Hi @Yume-Ke

You need to change the model to Show-UI. You are using base model (qwen2vl), so you have this issue.

ThreeSR avatar Apr 06 '25 21:04 ThreeSR

@ThreeSR I've tried your suggestion, and it works. Thanks a lot!

Yume-Ke avatar Apr 07 '25 01:04 Yume-Ke

after using showlab I met this problem Input string '{'action': 'CLICK' doesn't match the expected format format wrong with 44's prediction: {'action': 'CLICK Input string '' doesn't match the expected format format wrong with 45's prediction: Input string '' doesn't match the expected format format wrong with 46's prediction: Input string '' doesn't match the expected format format wrong with 47's prediction: Input string '' doesn't match the expected format format wrong with 48's prediction: Input string '' doesn't match the expected format format wrong with 49's prediction: Input string '' doesn't match the expected format format wrong with 50's prediction: Input string '' doesn't match the expected format format wrong with 51's prediction: Input string '' doesn't match the expected format format wrong with 52's prediction: Input string '' doesn't match the expected format format wrong with 53's prediction: Input string '' doesn't match the expected format format wrong with 54's prediction: Input string '' doesn't match the expected format format wrong with 55's prediction: Input string '' doesn't match the expected format format wrong with 56's prediction: Input string '' doesn't match the expected format format wrong with 57's prediction: Input string '' doesn't match the expected format format wrong with 58's prediction: Input string '' doesn't match the expected format format wrong with 59's prediction: Input string '' doesn't match the expected format format wrong with 60's prediction: Input string '' doesn't match the expected format format wrong with 61's prediction: Input string '' doesn't match the expected format format wrong with 62's prediction: Input string '' doesn't match the expected format format wrong with 63's prediction: Input string '' doesn't match the expected format format wrong with 64's prediction: Input string '' doesn't match the expected format format wrong with 65's prediction: Input string '' doesn't match the expected format format wrong with 66's prediction: Input string '' doesn't match the expected format format wrong with 67's prediction: Input string '' doesn't match the expected format format wrong with 68's prediction: Input string '' doesn't match the expected format format wrong with 69's prediction: Input string '' doesn't match the expected format format wrong with 70's prediction: Input string '' doesn't match the expected format format wrong with 71's prediction: Input string '' doesn't match the expected format format wrong with 72's prediction: Input string '' doesn't match the expected format format wrong with 73's prediction: Input string '' doesn't match the expected format format wrong with 74's prediction: Input string '' doesn't match the expected format format wrong with 75's prediction: Input string '' doesn't match the expected format format wrong with 76's prediction: 77it [00:00, 3627.56it/s] INFO:root:============================== INFO:root:test_domain INFO:root:============================== INFO:root:[Operation F1]: 0.0 INFO:root:[Element Acc]: 0.0 INFO:root:[Step Success]: 0.0 INFO:root:[Episode Success]: 0.0 INFO:root:[Operation F1 cate]: [0.0, 0.0, 0.0] INFO:root:[Macro Ele Acc]: 0.0 INFO:root:[Macro Op F1]: 0.0 INFO:root:[Macro Step SR]: 0.0 INFO:root:============================== INFO:root:test_task INFO:root:============================== INFO:root:[Operation F1]: nan INFO:root:[Element Acc]: 0.0 INFO:root:[Step Success]: 0.0 INFO:root:[Episode Success]: 0.0 INFO:root:[Operation F1 cate]: [0.0, 0.0, nan] INFO:root:[Macro Ele Acc]: 0.0 INFO:root:[Macro Op F1]: 0.0 INFO:root:[Macro Step SR]: 0.0 INFO:root:============================== INFO:root:test_website INFO:root:============================== INFO:root:[Operation F1]: 0.0 INFO:root:[Element Acc]: 0.0 INFO:root:[Step Success]: 0.0 INFO:root:[Episode Success]: 0.0 INFO:root:[Operation F1 cate]: [0.0, 0.0, 0.0] INFO:root:[Macro Ele Acc]: 0.0 INFO:root:[Macro Op F1]: 0.0 INFO:root:[Macro Step SR]: 0.0 wandb: ⣯ uploading data (5.8s)

How to revise Thanks @ThreeSR @Yume-Ke @BrightHai @yyyang404 @h-siyuan

Jack1447 avatar Jan 23 '26 12:01 Jack1447

It looks like a parsing error, you can take a look at cooresponding code.

ThreeSR avatar Jan 23 '26 14:01 ThreeSR