-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[PyOV] Propagate errors on imports from runtime module #20273
Changes from 1 commit
2a846ac
8a6f45f
f97a42d
6514e60
55600f9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,47 +12,47 @@ | |
except ImportError: | ||
pass | ||
|
||
# API 2.0 | ||
try: | ||
# Import all public modules | ||
from openvino import runtime as runtime | ||
from openvino import frontend as frontend | ||
from openvino import helpers as helpers | ||
from openvino import preprocess as preprocess | ||
from openvino import utils as utils | ||
from openvino.runtime import properties as properties | ||
|
||
# Import most important classes and functions from openvino.runtime | ||
from openvino.runtime import Model | ||
from openvino.runtime import Core | ||
from openvino.runtime import CompiledModel | ||
from openvino.runtime import InferRequest | ||
from openvino.runtime import AsyncInferQueue | ||
|
||
from openvino.runtime import Dimension | ||
from openvino.runtime import Strides | ||
from openvino.runtime import PartialShape | ||
from openvino.runtime import Shape | ||
from openvino.runtime import Layout | ||
from openvino.runtime import Type | ||
from openvino.runtime import Tensor | ||
from openvino.runtime import OVAny | ||
|
||
from openvino.runtime import compile_model | ||
from openvino.runtime import get_batch | ||
from openvino.runtime import set_batch | ||
from openvino.runtime import serialize | ||
from openvino.runtime import shutdown | ||
from openvino.runtime import tensor_from_file | ||
from openvino.runtime import save_model | ||
from openvino.runtime import layout_helpers | ||
|
||
# Set version for openvino package | ||
from openvino.runtime import get_version | ||
__version__ = get_version() | ||
except ImportError: | ||
import warnings | ||
warnings.warn("openvino package has problems with imports!", ImportWarning, stacklevel=2) | ||
# # | ||
# # API 2.0 | ||
# # This __init__.py forces checking of runtime modules to propagate errors. | ||
# # It is not compared with init files from openvino-dev package. | ||
# # | ||
# Import all public modules | ||
from openvino import runtime as runtime | ||
from openvino import frontend as frontend | ||
from openvino import helpers as helpers | ||
from openvino import preprocess as preprocess | ||
from openvino import utils as utils | ||
from openvino.runtime import properties as properties | ||
|
||
# Import most important classes and functions from openvino.runtime | ||
from openvino.runtime import Model | ||
from openvino.runtime import Core | ||
from openvino.runtime import CompiledModel | ||
from openvino.runtime import InferRequest | ||
from openvino.runtime import AsyncInferQueue | ||
|
||
from openvino.runtime import Dimension | ||
from openvino.runtime import Strides | ||
from openvino.runtime import PartialShape | ||
from openvino.runtime import Shape | ||
from openvino.runtime import Layout | ||
from openvino.runtime import Type | ||
from openvino.runtime import Tensor | ||
from openvino.runtime import OVAny | ||
|
||
from openvino.runtime import compile_model | ||
from openvino.runtime import get_batch | ||
from openvino.runtime import set_batch | ||
from openvino.runtime import serialize | ||
from openvino.runtime import shutdown | ||
from openvino.runtime import tensor_from_file | ||
from openvino.runtime import save_model | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we have There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it's below in a separate try / catch block. This is because if I use only python API from build folder, OVC is not there |
||
from openvino.runtime import layout_helpers | ||
|
||
# Set version for openvino package | ||
from openvino.runtime import get_version | ||
__version__ = get_version() | ||
|
||
# Tools | ||
try: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need all these runtime copies at all?
maybe we need to keep only
"${OpenVINOPython_SOURCE_DIR}/src/openvino/__init__.py"
? All other runtime modules cannot be used without OpenVINO anyway