# Yolov7-e6e.pt 양자화 과정 오류

**URL:** <https://forums.furiosa.ai/t/yolov7-e6e-pt/124>\
**Category:** 일반\
**Created:** [November 14, 2023, 7:52am UTC](https://forums.furiosa.ai/t/yolov7-e6e-pt/124 "2023-11-14T07:52:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dasnny0628](https://avatars.discourse-cdn.com/v4/letter/d/8baadc/32.png) [@dasnny0628](https://forums.furiosa.ai/u/dasnny0628)\
**Post date:** [November 14, 2023, 7:52am UTC](https://forums.furiosa.ai/t/yolov7-e6e-pt/124/1 "2023-11-14T07:52:27Z")

</div>

안녕하세요. 프로메디우스 김민준 연구원입니다.

학습이 완료된 yolov7-e6e.pt 을 양자화 진행할때,  
yolov7의 furiosa\_quantize.py의

```auto
ㅇ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가 달라서 바꾸어야 되는 코드를 제공해주실 수 있나요?

---

<div class="post-metadata">

**Author:** ![dreameye98](https://yyz1.discourse-cdn.com/flex031/user_avatar/forums.furiosa.ai/dreameye98/32/8_2.png) [@dreameye98](https://forums.furiosa.ai/u/dreameye98)\
**Post date:** [November 16, 2023, 3:07am UTC](https://forums.furiosa.ai/t/yolov7-e6e-pt/124/2 "2023-11-16T03:07:10Z")

</div>

안녕하세요 FuriosaAI 정영범입니다.  
yolov7-e6e도 yolov7과 동일한 위치를 자르면 됩니다. 다만 레이어의 이름이 바뀌어서 모델에서 확인하시고 해당 이름으로 변경하셔야합니다.  
추가로 컴파일시에 instruction 메모리 크기에 한번에 들어오지않아, 컴파일시에 아래의 옵션을 주어야합니다. `use_program_loading: True`
