Error saving quantized model

Im getting the same error. Im trying to save a quantized model using the following line torch.quantization.quantize_dynamic(model, {torch.nn.Linear}, dtype=torch.float16).

When running quantized_model.save_pretrained(path_dir), I’m running into the error AttributeError: ‘torch.dtype’ object has no attribute ‘numel’.

Anyone have a solution?

1 Like