Skip to content

Commit

Permalink
Fixed testdata generation for mulit-config generators
Browse files Browse the repository at this point in the history
  • Loading branch information
ilya-lavrenov committed Oct 1, 2023
1 parent 6792465 commit 9454ec5
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 22 deletions.
4 changes: 2 additions & 2 deletions src/frontends/paddle/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ endif()
# PDPD 2.5.1 is not compatible with tests models we use
set(paddlepaddle_FOUND OFF)

set(TEST_PADDLE_MODELS_DIRNAME test_model_zoo/paddle_test_models)
set(TEST_PADDLE_MODELS_DIRNAME ${TEST_MODEL_ZOO}/paddle_test_models)
target_compile_definitions(${TARGET_NAME} PRIVATE -D TEST_PADDLE_MODELS_DIRNAME=\"${TEST_PADDLE_MODELS_DIRNAME}/\")

set(PADDLEDET_OPS_URL "https://raw.githubusercontent.com/PaddlePaddle/PaddleDetection/release/2.1/ppdet/modeling/ops.py")
Expand All @@ -58,7 +58,7 @@ DownloadAndCheck(${PADDLEDET_OPS_URL} ${PADDLEDET_DIRNAME}/ops.py PADDLEDET_FATA
# This is done this way for 'code style' and check cases - cmake shall pass, but CI machine doesn't need to have
# 'paddlepaddle' installed to check code style
if(paddlepaddle_FOUND AND PADDLEDET_RESULT)
set(TEST_PADDLE_MODELS ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${TEST_PADDLE_MODELS_DIRNAME}/)
set(TEST_PADDLE_MODELS ${TEST_MODEL_ZOO_OUTPUT_DIR}/paddle_test_models/)

file(GLOB_RECURSE PADDLE_ALL_SCRIPTS ${CMAKE_CURRENT_SOURCE_DIR}/*.py)
set(OUT_FILE ${TEST_PADDLE_MODELS}/generate_done.txt)
Expand Down
4 changes: 2 additions & 2 deletions src/frontends/tensorflow/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ ov_check_pip_packages(REQUIREMENTS_FILE "${CMAKE_CURRENT_SOURCE_DIR}/requirement
WARNING_MESSAGE "TensorFlow testing models weren't generated, some tests will fail due models not found"
RESULT_VAR tensorflow_FOUND)

set(TEST_TENSORFLOW_MODELS_DIRNAME test_model_zoo/tensorflow_test_models)
set(TEST_TENSORFLOW_MODELS_DIRNAME ${TEST_MODEL_ZOO}/tensorflow_test_models)
target_compile_definitions(${TARGET_NAME} PRIVATE -D TEST_TENSORFLOW_MODELS_DIRNAME=\"${TEST_TENSORFLOW_MODELS_DIRNAME}/\")

# If 'tensorflow' is not found, code will still be compiled
# but models will not be generated and tests will fail
# This is done this way for 'code style' and check cases - cmake shall pass, but CI machine doesn't need to have
# 'tensorflow' installed to check code style
if (tensorflow_FOUND)
set(TEST_TENSORFLOW_MODELS ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${TEST_TENSORFLOW_MODELS_DIRNAME}/)
set(TEST_TENSORFLOW_MODELS ${TEST_MODEL_ZOO_OUTPUT_DIR}/tensorflow_test_models/)

file(GLOB_RECURSE TENSORFLOW_GEN_SCRIPTS ${CMAKE_CURRENT_SOURCE_DIR}/test_models/gen_scripts/generate_*.py)
file(GLOB_RECURSE TENSORFLOW_MODELS_PBTXT ${CMAKE_CURRENT_SOURCE_DIR}/test_models/models_pbtxt/*.pbtxt)
Expand Down
4 changes: 2 additions & 2 deletions src/frontends/tensorflow_lite/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ ov_check_pip_packages(REQUIREMENTS_FILE "${CMAKE_CURRENT_SOURCE_DIR}/requirement
WARNING_MESSAGE "TensorFlow Lite testing models weren't generated, some tests will fail due models not found"
RESULT_VAR tensorflow_FOUND)

set(TEST_TENSORFLOW_LITE_MODELS_DIRNAME test_model_zoo/tensorflow_lite_test_models)
set(TEST_TENSORFLOW_LITE_MODELS_DIRNAME ${TEST_MODEL_ZOO}/tensorflow_lite_test_models)
target_compile_definitions(${TARGET_NAME} PRIVATE -D TEST_TENSORFLOW_LITE_MODELS_DIRNAME=\"${TEST_TENSORFLOW_LITE_MODELS_DIRNAME}/\")

# If 'tensorflow' is not found, code will still be compiled
# but models will not be generated and tests will fail
# This is done this way for 'code style' and check cases - cmake shall pass, but CI machine doesn't need to have
# 'tensorflow' installed to check code style
if (tensorflow_FOUND)
set(TEST_TENSORFLOW_LITE_MODELS ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${TEST_TENSORFLOW_LITE_MODELS_DIRNAME}/)
set(TEST_TENSORFLOW_LITE_MODELS "${TEST_MODEL_ZOO_OUTPUT_DIR}/tensorflow_lite_test_models")

file(GLOB_RECURSE TENSORFLOW_GEN_SCRIPTS ${CMAKE_CURRENT_SOURCE_DIR}/test_models/gen_scripts/generate_*.py)
file(GLOB_RECURSE TENSORFLOW_ALL_SCRIPTS ${CMAKE_CURRENT_SOURCE_DIR}/*.py)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"appPath" : "/<e2e_path>/e2e/frameworks.ai.openvino.tests/e2e_oss/",
"appCmd" : "pytest test_dynamism.py <e2e_args>",
"envVars" : [
{"name" : "PYTHONPATH", "val" : "/<ov_path>/bin/intel64/Release/python_api/python3.8/"},
{"name" : "PYTHONPATH", "val" : "/<ov_path>/bin/intel64/Release/python/"},
{"name" : "LD_LIBRARY_PATH", "val" : "/<ov_path>/bin/intel64/Release/"},
{"name" : "MO_ROOT", "val" : "/<ov_path>/tools/mo/openvino/tools/"},
{"name" : "OPENVINO_ROOT_DIR", "val" : "/<ov_path>/"}
Expand Down
21 changes: 8 additions & 13 deletions tools/mo/openvino/tools/mo/utils/find_ie_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,25 +78,21 @@ def find_ie_version(silent=False):
if try_to_import_ie(silent=silent):
return True

python_version = 'python{}.{}'.format(sys.version_info[0], sys.version_info[1])

script_path = os.path.realpath(os.path.dirname(__file__))

# Windows
bindings_paths_windows = [
# Local builds
{
"module": os.path.join(script_path, '../../../../../../bin/intel64/Release/python_api/', python_version),
"module": os.path.join(script_path, '../../../../../../bin/intel64/Release/python/'),
"libs": [
os.path.join(script_path, '../../../../../../bin/intel64'),
os.path.join(script_path, '../../../../../../bin/intel64/Release'),
os.path.join(script_path, '../../../../../../temp/tbb/bin'),
]
},
{
"module": os.path.join(script_path, '../../../../../../bin/intel64/Debug/python_api/', python_version),
"module": os.path.join(script_path, '../../../../../../bin/intel64/Debug/python/'),
"libs": [
os.path.join(script_path, '../../../../../../bin/intel64'),
os.path.join(script_path, '../../../../../../bin/intel64/Debug'),
os.path.join(script_path, '../../../../../../temp/tbb/bin'),
]
Expand All @@ -107,22 +103,21 @@ def find_ie_version(silent=False):
bindings_paths_linux = [
# Local builds
{
"module": os.path.join(script_path, '../../../../../../bin/intel64/Release/lib/python_api/', python_version),
"module": os.path.join(script_path, '../../../../../../bin/intel64/Release/python/'),
"libs": [
os.path.join(script_path, '../../../../../../bin/intel64/Release/lib'),
os.path.join(script_path, '../../../../../../bin/intel64/Release'),
]
},

{
"module": os.path.join(script_path, '../../../../../../bin/intel64/RelWithDebInfo/lib/python_api/', python_version),
"module": os.path.join(script_path, '../../../../../../bin/intel64/RelWithDebInfo/python'),
"libs": [
os.path.join(script_path, '../../../../../../bin/intel64/RelWithDebInfo/lib'),
os.path.join(script_path, '../../../../../../bin/intel64/RelWithDebInfo'),
]
},
{
"module": os.path.join(script_path, '../../../../../../bin/intel64/Debug/lib/python_api/', python_version),
"module": os.path.join(script_path, '../../../../../../bin/intel64/Debug/python'),
"libs": [
os.path.join(script_path, '../../../../../../bin/intel64/Debug/lib'),
os.path.join(script_path, '../../../../../../bin/intel64/Debug'),
]
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ set(CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY_OLD ${CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY}
set(CMAKE_PDB_OUTPUT_DIRECTORY_OLD ${CMAKE_PDB_OUTPUT_DIRECTORY})

if(OV_GENERATOR_MULTI_CONFIG)
set(PYTHON_BRIDGE_OUTPUT_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/$<CONFIG>/python_api)
set(PYTHON_BRIDGE_OUTPUT_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/$<CONFIG>/python/openvino)
else()
set(PYTHON_BRIDGE_OUTPUT_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/python_api)
set(PYTHON_BRIDGE_OUTPUT_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/python/openvino)
endif()

set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PYTHON_BRIDGE_OUTPUT_DIRECTORY})
Expand Down

0 comments on commit 9454ec5

Please sign in to comment.