ThisisBillhe / EfficientDM

[ICLR 2024 Spotlight] This is the official PyTorch implementation of "EfficientDM: Efficient Quantization-Aware Fine-Tuning of Low-Bit Diffusion Models"
MIT License
49 stars 3 forks source link

Dimension error #2

Open zerohye opened 5 months ago

zerohye commented 5 months ago

There is dimension error. How can I resolve this? I think it's because context_dim in configs(yaml file) of cin256-v2 model is 512. What is the shape of cali_y[:32] in your code?

File "./quant_scripts/quant_layer.py", line 372, in forward out = self.fwd_func(input, weight, bias, **self.fwd_kwargs) RuntimeError: mat1 and mat2 shapes cannot be multiplied (3072x64 and 512x384)

Occured at In '_quantize_ldmnaive.py', _ = qnn(cali_images[:32].to(device),cali_t[:32].to(device),cali_y[:32].to(device))

zerohye commented 5 months ago

In the first step, when sampling data for calibration, you need to store image, timestep, and y, but the '_collect_input_4calib.py' code only stores the image. I arbitrarily modified it. Can you confirm again if the data saved after sampling includes all three variables?