Skip to content

AttributeError: 'Parameter' object has no attribute 'qtype' #58

@sxy771

Description

@sxy771

CUDA_VISIBLE_DEVICES=1 accelerate launch --num_processes 1 train_4090.py --config ./train_configs/train_lora_4090.yaml
The following values were not passed to accelerate launch and had defaults used instead:
--num_machines was set to a value of 1
--mixed_precision was set to a value of 'no'
--dynamo_backend was set to a value of 'no'
To avoid this warning pass in values for each of the problematic parameters or run accelerate config.
INFO:main:Distributed environment: NO
Num processes: 1
Process index: 0
Local process index: 0
Device: cuda

Mixed precision type: bf16

Loading pipeline components...: 0%| | 0/3 [00:00<?, ?it/s]Loaded scheduler as FlowMatchEulerDiscreteScheduler from scheduler subfolder of /Qwen-Image.
Loading checkpoint shards: 100%|█████████████████████████████████████████████████████████████████████| 4/4 [00:00<00:00, 28.86it/s]
Loaded text_encoder as Qwen2_5_VLForConditionalGeneration from text_encoder subfolder of /Qwen-Image.00:00, 17.59it/s]
Loading pipeline components...: 67%|██████████████████████████████████████████▋ | 2/3 [00:00<00:00, 10.60it/s]Loaded tokenizer as Qwen2Tokenizer from tokenizer subfolder of /Qwen-Image.
Loading pipeline components...: 100%|████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 10.33it/s]
100%|██████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:00<00:00, 17.55it/s]
All model checkpoint weights were used when initializing AutoencoderKLQwenImage.

All the weights of AutoencoderKLQwenImage were initialized from the model checkpoint at /Qwen-Image.
If your task is similar to the task the model of the checkpoint was trained on, you can already use AutoencoderKLQwenImage for predictions without further training.
100%|████████████████████████████████████████████████████████████████████████████████████████████████| 8/8 [00:00<00:00, 8.72it/s]
The config attributes {'pooled_projection_dim': 768} were passed to QwenImageTransformer2DModel, but are not expected and will be ignored. Please verify your config.json configuration file.
Loading checkpoint shards: 100%|█████████████████████████████████████████████████████████████████████| 9/9 [00:23<00:00, 2.65s/it]
All model checkpoint weights were used when initializing QwenImageTransformer2DModel.

All the weights of QwenImageTransformer2DModel were initialized from the model checkpoint at /Qwen-Image.
If your task is similar to the task the model of the checkpoint was trained on, you can already use QwenImageTransformer2DModel for predictions without further training.
100%|██████████████████████████████████████████████████████████████████████████████████████████████| 60/60 [00:25<00:00, 2.37it/s]
Traceback (most recent call last):
File "./flymyai-lora-trainer/train_4090.py", line 490, in
main()
File "./flymyai-lora-trainer/train_4090.py", line 231, in main
quantize(flux_transformer, weights=qfloat8, activations=qfloat8)
File ".conda/envs/qwen-edit/lib/python3.10/site-packages/optimum/quanto/quantize.py", line 98, in quantize
quantize_submodule(model, name, m, weights=weights, activations=activations, optimizer=optimizer)
File ".conda/envs/qwen-edit/lib/python3.10/site-packages/optimum/quanto/quantize.py", line 45, in quantize_submodule
qmodule = quantize_module(module, weights=weights, activations=activations, optimizer=optimizer)
File ".conda/envs/qwen-edit/lib/python3.10/site-packages/optimum/quanto/nn/qmodule.py", line 86, in quantize_module
return qcls.from_module(module, weights=weights, activations=activations, optimizer=optimizer)
File ".conda/envs/qwen-edit/lib/python3.10/site-packages/optimum/quanto/nn/qmodule.py", line 206, in from_module
qmodule.weight.copy
(module.weight)
File ".conda/envs/qwen-edit/lib/python3.10/site-packages/optimum/quanto/tensor/qtensor.py", line 93, in torch_function
return func(*args, **kwargs)
File ".conda/envs/qwen-edit/lib/python3.10/site-packages/optimum/quanto/tensor/qbytes.py", line 130, in torch_dispatch
return qdispatch(*args, **kwargs)
File ".conda/envs/qwen-edit/lib/python3.10/site-packages/optimum/quanto/tensor/qbytes_ops.py", line 121, in copy

assert dest.qtype == src.qtype
AttributeError: 'Parameter' object has no attribute 'qtype'
Traceback (most recent call last):
File ".conda/envs/qwen-edit/bin/accelerate", line 7, in
sys.exit(main())
File ".conda/envs/qwen-edit/lib/python3.10/site-packages/accelerate/commands/accelerate_cli.py", line 50, in main
args.func(args)
File ".conda/envs/qwen-edit/lib/python3.10/site-packages/accelerate/commands/launch.py", line 1235, in launch_command
simple_launcher(args)
File ".conda/envs/qwen-edit/lib/python3.10/site-packages/accelerate/commands/launch.py", line 823, in simple_launcher
raise subprocess.CalledProcessError(returncode=process.returncode, cmd=cmd)
subprocess.CalledProcessError: Command '['.conda/envs/qwen-edit/bin/python3.10', 'train_4090.py', '--config', './train_configs/train_lora_4090.yaml']' returned non-zero exit status 1.

I've tried train_4090.py under RTX4090 environment but it happened the above issue.

Who know the solution?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions