When I run the ptq.py script, the following error was prompted. I found that only some modules have act_quant and weight_quant
python scripts/ptq.py --config ./configs/stable-diffusion/lcm_lora.yaml --outdir ./logs/lcm_dreamshaper8 --seed 42
File "MixDQ/quant_utils/qdiff/models/quant_block.py", line 589, in __call__
if is_cross_attn and ((attn.to_k.act_quant or attn.to_k.weight_quant) or (attn.to_v.act_quant or attn.to_v.weight_quant)):
File "envs/aigc_py310/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1695, in __getattr__
raise AttributeError(f"'{type(self).__name__}' object has no attribute '{name}'")
AttributeError: 'Linear' object has no attribute 'act_quant'
I changed this conditional statement to:
if is_cross_attn and ((getattr(attn.to_k,'act_quant', False) or getattr(attn.to_k, 'weight_quant', False)) or (getattr(attn.to_v, 'act_quant', False) or getattr(attn.to_v, 'weight_quant', False))):
When I run the ptq.py script, the following error was prompted. I found that only some modules have
act_quant
andweight_quant
I changed this conditional statement to:
if is_cross_attn and ((getattr(attn.to_k,'act_quant', False) or getattr(attn.to_k, 'weight_quant', False)) or (getattr(attn.to_v, 'act_quant', False) or getattr(attn.to_v, 'weight_quant', False))):
Is this correct?