안녕하세요. 프로메디우스 김민준 연구원입니다.
학습이 완료된 yolov7-e6e.pt 을 양자화 진행할때,
yolov7의 furiosa_quantize.py의
ㅇef extract_model(model: onnx.ModelProto, input_name):
"""Cut off the post-processing components."""
input_to_shape = [(input_name, (1, 3, *INPUT_SHAPE))]
# TODO: The cut points below were chosen so that the postprocess() function can follow the
# structure of the original PyTorch code as closely as possible. We need to experiment more with
# different cut points to achieve the best combination of speed and accuracy.
output_to_shape = (
("/model.105/m.0/Conv_output_0", (1, 255, 80, 80)),
("/model.105/m.1/Conv_output_0", (1, 255, 40, 40)),
("/model.105/m.2/Conv_output_0", (1, 255, 20, 20)),
)
output_to_shape = (
(
"/model.105/m.0/Conv_output_0",
(1, 255, int(INPUT_SHAPE[0] / 8), int(INPUT_SHAPE[1] / 8)),
),
(
"/model.105/m.1/Conv_output_0",
(1, 255, int(INPUT_SHAPE[0] / 16), int(INPUT_SHAPE[1] / 16)),
),
(
"/model.105/m.2/Conv_output_0",
(1, 255, int(INPUT_SHAPE[0] / 32), int(INPUT_SHAPE[1] / 32)),
),
부분에서
KeyError: ‘/model.105/m.2/Conv_output_0’
위와 같은 오류가 발생합니다.
yolov7.pt 와 yolov7-e6e.pt 를 양자화 할때 모델의 layer가 달라서 바꾸어야 되는 코드를 제공해주실 수 있나요?