ONNX Runtime Error

작성자 김아름 수정일 2022-10-17 15:29

#ONNX, #SparklingSoDA4.0, #스파클링소다4.0, #runtime, #onnx 에러

아티클 관련 제품: SparklingSoDA4.0

오류 메세지 혹은 현상
  • 터미널에서 model serving 테스트 중 아래의 오류가 발생합니다. 
    E1004 01:45:37.950859 406 model_repository_manager.cc:1186] failed to load 'bike-sharing-demand' version 1: Internal: onnx runtime error 1: Load model from model_repo/bike-sharing-demand/1/model.onnx failed:/workspace/onnxruntime/onnxruntime/core/graph/model_load_utils.h:47 void onnxruntime::model_load_utils::ValidateOpsetForDomain(const std::unordered_map<std::__cxx11::basic_string<char>, int>&, const onnxruntime::logging::Logger&, bool, const string&, int) ONNX Runtime only *guarantees* support for models stamped with official released onnx opset versions. Opset 17 is under development and support for this is limited. The operator schemas and or other functionality may change before next ONNX release and in this case ONNX Runtime will not guarantee backward compatibility. Current official support for domain ai.onnx is till opset 15.


원인
  • SparklingSoDA 4.0 Developer's Guide 의 Bike-Sharing-Demand 가이드를 따라하다 나타날 수 있습니다.

  • 이는 skl2onnx 버전을 확인해 보아야 합니다.

  • Bike-Sharing-Demand 프로젝트의 requirements는 seaborn, onnx, onnxconverter-common, skl2onnx 입니다.

  • 이때, onnx와 onnxconverter 및 skl2onnx의 버전은 아래와 같습니다.
    onnx==1.12.0
    onnxconverter-common==1.12.2
    skl2onnx==1.11



문제 해결
  • skl2onnx 패키지를 1.11로 install 한 후, 다시 serving test를 합니다.


  1. jupyter에서 터미널을 엽니다.


  2. 파이썬 패키지 list를 확인합니다.

    pip list
    Package                        Version
    ------------------------- --------------------
    ◦◦◦                             ◦◦◦
    skl2onnx                        1.13
    ◦◦◦                             ◦◦◦


  3. requirements.txt 파일을 수정합니다.

    seaborn
    onnx
    onnxconverter-common
    skl2onnx==1.11


  4. 패키지 reinstall 합니다.

    pip install -r requirements.txt
    Collecting skl2onnx==1.11
      Downloading http://devainexus/repository/pypi-hosted/packages/skl2onnx/1.11/skl2onnx-1.11-py2.py3-none-any.whl (274 kB)
         |████████████████████████████████| 274 kB 73.1 MB/s
    Installing collected packages: skl2onnx
      Attempting uninstall: skl2onnx
        Found existing installation: skl2onnx 1.13
        Uninstalling skl2onnx-1.13:
          Successfully uninstalled skl2onnx-1.13
    Successfully skl2onnx-1.11


  5. model server 테스트를 합니다.

    run_model_server.sh -m model_repo/
    Start model inference server (model_path=model_repo/)
    ◦◦◦
    I1004 04:19:28.527811 20 grpc_server.cc:4117] Started GRPCInferenceService at 0.0.0.0:8001
    I1004 04:19:28.528066 20 http_server.cc:2815] Started HTTPService at 0.0.0.0:8000
    I1004 04:19:28.569981 20 http_server.cc:167] Started Metrics Service at 0.0.0.0:8002

    log를 통해 local model server의 정상 실행을 확인할  수 있습니다.

아티클이 유용했나요?

훌륭합니다!

피드백을 제공해 주셔서 감사합니다.

도움이 되지 못해 죄송합니다!

피드백을 제공해 주셔서 감사합니다.

아티클을 개선할 수 있는 방법을 알려주세요!

최소 하나의 이유를 선택하세요
CAPTCHA 확인이 필요합니다.

피드백 전송

소중한 의견을 수렴하여 아티클을 개선하도록 노력하겠습니다.

02-558-8300