Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loading .onnx model on AWS Lambda image returns error. #18860

Open
vladb99 opened this issue Dec 18, 2023 · 3 comments
Open

Loading .onnx model on AWS Lambda image returns error. #18860

vladb99 opened this issue Dec 18, 2023 · 3 comments
Labels
ep:OpenVINO issues related to OpenVINO execution provider stale issues that have not been addressed in a while; categorized by a bot

Comments

@vladb99
Copy link

vladb99 commented Dec 18, 2023

Describe the issue

I'm trying to load a .onnx model, and then do inference with it. When loading the model from the .onnx file I get 'Failed to find location of the openvino_telemetry file.' error.

To reproduce

Docker file I use to build the image:

FROM public.ecr.aws/lambda/python:3.10

# Install OS packages for Pillow-SIMD
RUN yum -y install tar gzip zlib freetype-devel \
    gcc \
    ghostscript \
    lcms2-devel \
    libffi-devel \
    libimagequant-devel \
    libjpeg-devel \
    libraqm-devel \
    libtiff-devel \
    libwebp-devel \
    make \
    openjpeg2-devel \
    rh-python36 \
    rh-python36-python-virtualenv \
    sudo \
    tcl-devel \
    tk-devel \
    tkinter \
    which \
    xorg-x11-server-Xvfb \
    zlib-devel \
    libgomp \
    && yum clean all

# Installation of python requirements
COPY requirements.txt  .
RUN pip3 install -r requirements.txt --target "./"

# Copy model
COPY yolov7-w6-pose.onnx ./

# Copy function code
COPY app.py ./

# Set the CMD to your handler (could also be done as a parameter override outside of the Dockerfile)
CMD [ "app.lambda_handler" ]

The code in app.py:

import openvino as ov

def lambda_handler(event, context):
    modelPose = ov.convert_model("yolov7-w6-pose.onnx")
    core = ov.Core()
    modelPose = core.compile_model(modelPose, "AUTO")

The error I get:

Exception('Failed to find location of the openvino_telemetry file.')\nException: Failed to find location of the openvino_telemetry file.",
    "exception_name": "Exception",
    "stack_trace": {
        "type": "Exception",
        "value": "Failed to find location of the openvino_telemetry file.",
        "module": "builtins",
        "frames": [
            {
                "file": "/var/task/app.py",
                "line": 309,
                "function": "lambda_handler",
                "statement": "outputImage = handle_event(event)"
            },
            {
                "file": "/var/task/app.py",
                "line": 304,
                "function": "handle_event",
                "statement": "return apply_model(cv2_image)"
            },
            {
                "file": "/var/task/app.py",
                "line": 281,
                "function": "apply_model",
                "statement": "start(image)"
            },
            {
                "file": "/var/task/app.py",
                "line": 261,
                "function": "start",
                "statement": "modelPose = ov.convert_model(\"yolov7-w6-pose.onnx\")"
            },
            {
                "file": "/var/task/openvino/tools/ovc/convert.py",
                "line": 101,
                "function": "convert_model",
                "statement": "ov_model, _ = _convert(cli_parser, params, True)"
            },
            {
                "file": "/var/task/openvino/tools/ovc/convert_impl.py",
                "line": 420,
                "function": "_convert",
                "statement": "telemetry = init_mo_telemetry()"
            },
            {
                "file": "/var/task/openvino/tools/ovc/telemetry_utils.py",
                "line": 20,
                "function": "init_mo_telemetry",
                "statement": "return tm.Telemetry(tid=get_tid(),"
            },
            {
                "file": "/var/task/openvino_telemetry/main.py",
                "line": 27,
                "function": "__call__",
                "statement": "cls.__single_instance = super(SingletonMetaClass, cls).__call__(*args, **kwargs)"
            },
            {
                "file": "/var/task/openvino_telemetry/main.py",
                "line": 56,
                "function": "__init__",
                "statement": "self.init(app_name, app_version, tid, backend, enable_opt_in_dialog, disable_in_ci)"
            },
            {
                "file": "/var/task/openvino_telemetry/main.py",
                "line": 61,
                "function": "init",
                "statement": "opt_in_check_result = opt_in_checker.check(enable_opt_in_dialog, disable_in_ci)"
            },
            {
                "file": "/var/task/openvino_telemetry/utils/opt_in_checker.py",
                "line": 303,
                "function": "check",
                "statement": "if not os.path.exists(self.consent_file()):"
            },
            {
                "file": "/var/task/openvino_telemetry/utils/opt_in_checker.py",
                "line": 126,
                "function": "consent_file",
                "statement": "return os.path.join(self.consent_file_base_dir(), self.consent_file_subdirectory(), \"openvino_telemetry\")"
            },
            {
                "file": "/var/task/openvino_telemetry/utils/opt_in_checker.py",
                "line": 104,
                "function": "consent_file_base_dir",
                "statement": "raise Exception('Failed to find location of the openvino_telemetry file.')"
            }
        ]

How can I fix this issue? Thanks!

Urgency

No response

Platform

Linux

OS Version

Amazon Linux

ONNX Runtime Installation

Other / Unknown

ONNX Runtime Version or Commit ID

I don't know

ONNX Runtime API

Python

Architecture

Other / Unknown

Execution Provider

Default CPU

Execution Provider Library Version

No response

@github-actions github-actions bot added the ep:OpenVINO issues related to OpenVINO execution provider label Dec 18, 2023
@justinchuby
Copy link
Contributor

This seems to be an openvino issue. I suggest creating an issue with the https://github.com/openvinotoolkit/openvino repository

Copy link
Contributor

This issue has been automatically marked as stale due to inactivity and will be closed in 30 days if no further activity occurs. If further support is needed, please provide an update and/or more details.

@github-actions github-actions bot added the stale issues that have not been addressed in a while; categorized by a bot label Jan 18, 2024
@rickspark4
Copy link

hey @vladb99,
have you figured out anything on it
facing same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ep:OpenVINO issues related to OpenVINO execution provider stale issues that have not been addressed in a while; categorized by a bot
Projects
None yet
Development

No branches or pull requests

3 participants