Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

微调时出现TypeError: string indices must be integers错误 #65

Open
20191864218 opened this issue Nov 8, 2023 · 1 comment
Open

Comments

@20191864218
Copy link

Traceback (most recent call last):
File "/root/VisualGLM-6B/finetune_XrayGLM.py", line 194, in
training_main(args, model_cls=model, forward_step_function=forward_step, create_dataset_function=create_dataset_function, collate_fn=data_collator)
File "/root/miniconda3/lib/python3.10/site-packages/sat/training/deepspeed_training.py", line 67, in training_main
train_data, val_data, test_data = make_loaders(args, hooks['create_dataset_function'], collate_fn=collate_fn)
File "/root/miniconda3/lib/python3.10/site-packages/sat/data_utils/configure_data.py", line 198, in make_loaders
train = make_dataset(**data_set_args, args=args, dataset_weights=args.train_data_weights, is_train_data=True)
File "/root/miniconda3/lib/python3.10/site-packages/sat/data_utils/configure_data.py", line 124, in make_dataset_full
d = create_dataset_function(p, args)
File "/root/VisualGLM-6B/finetune_XrayGLM.py", line 160, in create_dataset_function
dataset = FewShotDataset(path, image_processor, tokenizer, args)
File "/root/VisualGLM-6B/finetune_XrayGLM.py", line 117, in init
image = processor(Image.open(item['img']).convert('RGB'))
TypeError: string indices must be integers
[2023-11-08 20:22:18,687] [INFO] [launch.py:315:sigkill_handler] Killing subprocess 4613
[2023-11-08 20:22:18,687] [ERROR] [launch.py:321:sigkill_handler] ['/root/miniconda3/bin/python', '-u', 'finetune_XrayGLM.py', '--local_rank=0', '--experiment-name', 'finetune-XrayGLM', '--model-parallel-size', '1', '--mode', 'finetune', '--train-iters', '300', '--resume-dataloader', '--max_source_length', '64', '--max_target_length', '256', '--lora_rank', '10', '--pre_seq_len', '4', '--train-data', '/root/autodl-tmp/Xray/openi-zh.json', '--valid-data', '/root/autodl-tmp/Xray/openi-zh.json', '--distributed-backend', 'nccl', '--lr-decay-style', 'cosine', '--warmup', '.02', '--checkpoint-activations', '--save-interval', '300', '--eval-interval', '10000', '--save', './checkpoints', '--split', '1', '--eval-iters', '10', '--eval-batch-size', '8', '--zero-stage', '1', '--lr', '0.0001', '--batch-size', '8', '--skip-init', '--fp16', '--use_lora'] exits with return code = 1

@steveyoung30
Copy link

需要改为 for item in data['annotations']

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants