when i quant yolov11 with aimet_torch,i get an error in aimet_torch/meta/connectedgraph.py,it is KeyError: '1'
When the activation function layer is not relu, there is a problem with the dictionary parsed by connectedgraph. At this time, a KeyError: '1' will be reported. I have modified the source code as follows. I don't know if such modifications will affect quantization. Can the official pay attention to this issue
if not (input_name in node_name_to_module.keys()): op_type = inputs[0].type() if "activation" in str(op_type): # in "torch.torch.nn.modules.activation.___torch_mangle_380.SiLU" node_name_to_module[input_name] = residing_module.act
@742671920 Thanks for reporting this issue! Could you please share the complete error trace and let us know which version of aimet-torch you are using? From your description, it seems that the graph parsing logic in aimet-torch is failing to correctly identify the SiLU activation layer.
@742671920 Thanks for reporting this issue! Could you please share the complete error trace and let us know which version of
aimet-torchyou are using? From your description, it seems that the graph parsing logic inaimet-torchis failing to correctly identify theSiLUactivation layer.
my aimet-torch==2.12.0 and torch==2.8.0
Also, I could not find an implementation of torch.cat in the file aimet_torch/v2/nn/base.py, which caused another problem, the network layer inherited from torch.cat could not be quantified, and the error type was: Aimet_torch. V2. Nn. Base. UnknownModuleError, whether I can be in accordance with nn. ReLu method to define the above two methods to solve I met error: UnknownModuleError, or prepare_model maybe solve the problem?
We no longer recommend using prepare_model, as it relies on torch.fx under the hood, which has several limitations when parsing PyTorch graphs. Instead, we recommend switching to aimet-onnx.
Could you please share minimal script to repro above issue? We will we fix for aimet-torch
In the meantime, could you please try aimet-onnx instead?
You can install it via:
pip install aimet-onnx
You'll need to export your model to ONNX format, but the rest of the workflow remains the same.