[PyOV] Enable Python 3.11 (#15144)
* Bump ONNX version * Bump protobuf * Add xfails and skips * Add tickets * Skip ONNX Serialization tests * Compile ONNX with C++17 * Force cpp17 - 2 * Use MSVC check * Relax python reqs, enable 311 in azure * Fix setupvars error * Ignore watchdog error * Update tensorflow * Minor change * Bump onnx to 1.13.1 * Bump protobuf to 3.20.3 * Debug test tf * Xfail tests in comp * Update comp tests * Update tf reqs * Remove deprecated ONNX function * Align PDPD FE protobuf req with 2.4.1 * Satisfy dependency review * Attempt to fix dependency review * Revert pdpd protobuf * Skip pdpd tests * Fix MO-TF-PB test * Skip TF test case * Enable py311 on rest of jobs * Try disabling pdpd req * Exclude pdpd form cmake * Update .ci/azure/linux.yml Fixed unmerged merge-conflict * CR * Fix reqs * Skip pdpd tests * Disable pdpd tests building in cmake * Skip another pdpd cmake * Add file * Add paddle constraint to tests * Disable paddle reqs * Debug prints * Skip TF test if Python ver is 3.11 * Apply Mish cr comments * Debug * Debug * Constrain tensorflow_addons * Fix pdpd skipping * Add debug prints * Update skips * Remove prints * Minor change * Update OMZ commit * Fix some tests * Minor change * Disable pdpd at all * Disable pdpd at all --------- Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com>
This commit is contained in:
committed by
GitHub
parent
589bd6d076
commit
d72d833a96
@@ -57,7 +57,7 @@ jobs:
|
||||
SHARE_DIR: /mount/cinfsshare/onnxtestdata
|
||||
CCACHE_DIR: $(SHARE_DIR)/ccache/master/android_arm64
|
||||
LD_LIBRARY_PATH: $(Agent.ToolsDirectory)/Python/$(OV_PYTHON_VERSION)/x64/lib
|
||||
OV_PYTHON_VERSION: 3.10.10 # Full version of Python its required for LD_LIBRARY_PATH. More details https://github.com/microsoft/azure-pipelines-tool-lib/blob/master/docs/overview.md#tool-cache
|
||||
OV_PYTHON_VERSION: 3.11.2 # Full version of Python its required for LD_LIBRARY_PATH. More details https://github.com/microsoft/azure-pipelines-tool-lib/blob/master/docs/overview.md#tool-cache
|
||||
|
||||
steps:
|
||||
- task: UsePythonVersion@0
|
||||
@@ -67,7 +67,7 @@ jobs:
|
||||
disableDownloadFromRegistry: false
|
||||
architecture: 'x64'
|
||||
githubToken: $(auth_token)
|
||||
displayName: Setup Python 3.10
|
||||
displayName: Setup Python 3.11
|
||||
name: setupPython
|
||||
- bash: |
|
||||
#!/bin/bash
|
||||
|
||||
@@ -100,7 +100,7 @@ jobs:
|
||||
BUILD_PYTHON: $(WORK_DIR)/build_python
|
||||
INSTALL_PYTHON: $(INSTALL_OPENVINO)/extras/python
|
||||
LD_LIBRARY_PATH: $(Agent.ToolsDirectory)/Python/$(OV_PYTHON_VERSION)/x64/lib
|
||||
OV_PYTHON_VERSION: 3.10.10 # Full version of Python its required for LD_LIBRARY_PATH. More details https://github.com/microsoft/azure-pipelines-tool-lib/blob/master/docs/overview.md#tool-cache
|
||||
OV_PYTHON_VERSION: 3.11.2 # Full version of Python its required for LD_LIBRARY_PATH. More details https://github.com/microsoft/azure-pipelines-tool-lib/blob/master/docs/overview.md#tool-cache
|
||||
|
||||
steps:
|
||||
- task: UsePythonVersion@0
|
||||
@@ -110,7 +110,7 @@ jobs:
|
||||
disableDownloadFromRegistry: false
|
||||
architecture: 'x64'
|
||||
githubToken: $(auth_token)
|
||||
displayName: Setup Python 3.10
|
||||
displayName: Setup Python 3.11
|
||||
name: setupPython
|
||||
- bash: |
|
||||
#!/bin/bash
|
||||
@@ -172,7 +172,8 @@ jobs:
|
||||
# For running Python API tests
|
||||
python3 -m pip install -r $(REPO_DIR)/src/bindings/python/src/compatibility/openvino/requirements-dev.txt
|
||||
# For running Paddle frontend unit tests
|
||||
python3 -m pip install -r $(REPO_DIR)/src/frontends/paddle/tests/requirements.txt
|
||||
# TODO Reenable PDPD after paddlepaddle==2.5.0 with compliant protobuf is released (ticket 95904)
|
||||
#python3 -m pip install -r $(REPO_DIR)/src/frontends/paddle/tests/requirements.txt
|
||||
# For running ONNX frontend unit tests
|
||||
python3 -m pip install -r $(REPO_DIR)/src/frontends/onnx/tests/requirements.txt
|
||||
# For running TensorFlow frontend unit tests
|
||||
|
||||
@@ -81,7 +81,7 @@ jobs:
|
||||
OPENCV_CCACHE_DIR: $(SHARE_DIR)/ccache/master/linux_arm64_opencv
|
||||
ONETBB_CCACHE_DIR: $(SHARE_DIR)/ccache/master/linux_arm64_onetbb
|
||||
LD_LIBRARY_PATH: $(Agent.ToolsDirectory)/Python/$(OV_PYTHON_VERSION)/x64/lib
|
||||
OV_PYTHON_VERSION: 3.10.10 # Full version of Python its required for LD_LIBRARY_PATH. More details https://github.com/microsoft/azure-pipelines-tool-lib/blob/master/docs/overview.md#tool-cache
|
||||
OV_PYTHON_VERSION: 3.11.2 # Full version of Python its required for LD_LIBRARY_PATH. More details https://github.com/microsoft/azure-pipelines-tool-lib/blob/master/docs/overview.md#tool-cache
|
||||
|
||||
steps:
|
||||
- task: UsePythonVersion@0
|
||||
@@ -91,7 +91,7 @@ jobs:
|
||||
disableDownloadFromRegistry: false
|
||||
architecture: 'x64'
|
||||
githubToken: $(auth_token)
|
||||
displayName: Setup Python 3.10
|
||||
displayName: Setup Python 3.11
|
||||
name: setupPython
|
||||
- bash: |
|
||||
#!/bin/bash
|
||||
|
||||
@@ -59,7 +59,7 @@ jobs:
|
||||
INSTALL_DIR: $(WORK_DIR)/install_pkg
|
||||
SETUPVARS: $(INSTALL_DIR)/setupvars.sh
|
||||
LD_LIBRARY_PATH: $(Agent.ToolsDirectory)/Python/$(OV_PYTHON_VERSION)/x64/lib
|
||||
OV_PYTHON_VERSION: 3.10.10 # Full version of Python its required for LD_LIBRARY_PATH. More details https://github.com/microsoft/azure-pipelines-tool-lib/blob/master/docs/overview.md#tool-cache
|
||||
OV_PYTHON_VERSION: 3.11.2 # Full version of Python its required for LD_LIBRARY_PATH. More details https://github.com/microsoft/azure-pipelines-tool-lib/blob/master/docs/overview.md#tool-cache
|
||||
|
||||
steps:
|
||||
- task: UsePythonVersion@0
|
||||
@@ -69,7 +69,7 @@ jobs:
|
||||
disableDownloadFromRegistry: false
|
||||
architecture: 'x64'
|
||||
githubToken: $(auth_token)
|
||||
displayName: Setup Python 3.10
|
||||
displayName: Setup Python 3.11
|
||||
name: setupPython
|
||||
- bash: |
|
||||
#!/bin/bash
|
||||
|
||||
@@ -33,7 +33,7 @@ jobs:
|
||||
SHARE_DIR: /mount/cinfsshare/onnxtestdata
|
||||
CCACHE_DIR: $(SHARE_DIR)/ccache/master/linux_coverity
|
||||
LD_LIBRARY_PATH: $(Agent.ToolsDirectory)/Python/$(OV_PYTHON_VERSION)/x64/lib
|
||||
OV_PYTHON_VERSION: 3.10.10 # Full version of Python its required for LD_LIBRARY_PATH. More details https://github.com/microsoft/azure-pipelines-tool-lib/blob/master/docs/overview.md#tool-cache
|
||||
OV_PYTHON_VERSION: 3.11.2 # Full version of Python its required for LD_LIBRARY_PATH. More details https://github.com/microsoft/azure-pipelines-tool-lib/blob/master/docs/overview.md#tool-cache
|
||||
|
||||
steps:
|
||||
- task: UsePythonVersion@0
|
||||
@@ -43,7 +43,7 @@ jobs:
|
||||
disableDownloadFromRegistry: false
|
||||
architecture: 'x64'
|
||||
githubToken: $(auth_token)
|
||||
displayName: Setup Python 3.10
|
||||
displayName: Setup Python 3.11
|
||||
name: setupPython
|
||||
- bash: |
|
||||
#!/bin/bash
|
||||
|
||||
@@ -56,7 +56,7 @@ jobs:
|
||||
ONNXRUNTIME_UTILS: $(REPO_DIR)/.ci/azure/ci_utils/onnxruntime
|
||||
ONNXRUNTIME_BUILD_DIR: $(ONNXRUNTIME_REPO_DIR)/build
|
||||
LD_LIBRARY_PATH: $(Agent.ToolsDirectory)/Python/$(OV_PYTHON_VERSION)/x64/lib
|
||||
OV_PYTHON_VERSION: 3.10.10 # Full version of Python its required for LD_LIBRARY_PATH. More details https://github.com/microsoft/azure-pipelines-tool-lib/blob/master/docs/overview.md#tool-cache
|
||||
OV_PYTHON_VERSION: 3.11.2 # Full version of Python its required for LD_LIBRARY_PATH. More details https://github.com/microsoft/azure-pipelines-tool-lib/blob/master/docs/overview.md#tool-cache
|
||||
|
||||
steps:
|
||||
- task: UsePythonVersion@0
|
||||
@@ -66,7 +66,7 @@ jobs:
|
||||
disableDownloadFromRegistry: false
|
||||
architecture: 'x64'
|
||||
githubToken: $(auth_token)
|
||||
displayName: Setup Python 3.10
|
||||
displayName: Setup Python 3.11
|
||||
name: setupPython
|
||||
- bash: |
|
||||
#!/bin/bash
|
||||
|
||||
@@ -73,11 +73,11 @@ jobs:
|
||||
steps:
|
||||
- task: UsePythonVersion@0
|
||||
inputs:
|
||||
versionSpec: '3.10'
|
||||
versionSpec: '3.11.2'
|
||||
addToPath: true
|
||||
architecture: 'x64'
|
||||
githubToken: $(auth_token)
|
||||
displayName: Setup Python 3.10
|
||||
displayName: Setup Python 3.11
|
||||
name: setupPython
|
||||
|
||||
- script: |
|
||||
@@ -113,10 +113,6 @@ jobs:
|
||||
lfs: 'true'
|
||||
path: testdata
|
||||
|
||||
- task: UsePythonVersion@0
|
||||
inputs:
|
||||
versionSpec: '3.10'
|
||||
|
||||
- script: |
|
||||
brew install cython
|
||||
brew install automake
|
||||
|
||||
@@ -73,7 +73,7 @@ jobs:
|
||||
INSTALL_DIR: $(WORK_DIR)\install_pkg
|
||||
INSTALL_TEST_DIR: $(INSTALL_DIR)\tests
|
||||
SETUPVARS: $(INSTALL_DIR)\setupvars.bat
|
||||
PYTHON_DIR: C:\hostedtoolcache\windows\Python\3.10.7\x64
|
||||
PYTHON_DIR: C:\hostedtoolcache\windows\Python\3.11.2\x64
|
||||
CMAKE_VERSION: 3.24.0
|
||||
CMAKE_CMD: $(WORK_DIR)\cmake-$(CMAKE_VERSION)-windows-x86_64\cmake-$(CMAKE_VERSION)-windows-x86_64\bin\cmake.exe
|
||||
OV_CMAKE_TOOLCHAIN_FILE: $(REPO_DIR)\cmake\toolchains\mt.runtime.win32.toolchain.cmake
|
||||
@@ -84,26 +84,26 @@ jobs:
|
||||
- script: |
|
||||
rd /Q /S $(WORK_DIR) & mkdir $(WORK_DIR)
|
||||
rd /Q /S $(BUILD_DIR) & mkdir $(BUILD_DIR)
|
||||
rd /Q /S $(WORK_DIR) & mkdir C:\hostedtoolcache\windows\Python\3.10.7
|
||||
rd /Q /S $(BUILD_DIR) & mkdir C:\hostedtoolcache\windows\Python\3.10.7\x64
|
||||
rd /Q /S $(WORK_DIR) & mkdir C:\hostedtoolcache\windows\Python\3.11.2
|
||||
rd /Q /S $(BUILD_DIR) & mkdir C:\hostedtoolcache\windows\Python\3.11.2\x64
|
||||
rd /Q /S $(BUILD_SAMPLES_DIR) & mkdir $(BUILD_SAMPLES_DIR)
|
||||
rd /Q /S $(BUILD_SAMPLES_TESTS_DIR) & mkdir $(BUILD_SAMPLES_TESTS_DIR)
|
||||
displayName: 'Make dir'
|
||||
|
||||
- script: curl -O https://www.python.org/ftp/python/3.10.7/python-3.10.7-amd64.exe
|
||||
- script: curl -O https://www.python.org/ftp/python/3.11.2/python-3.11.2-amd64.exe
|
||||
displayName: 'Download Python'
|
||||
workingDirectory: $(WORK_DIR)
|
||||
|
||||
- script: |
|
||||
python-3.10.7-amd64.exe /passive InstallAllUsers=0 Include_launcher=0 TargetDir=C:\hostedtoolcache\windows\Python\3.10.7\x64
|
||||
cp C:\hostedtoolcache\windows\Python\3.8.2\x64.complete C:\hostedtoolcache\windows\Python\3.10.7\x64.complete
|
||||
python-3.11.2-amd64.exe /passive InstallAllUsers=0 Include_launcher=0 TargetDir=C:\hostedtoolcache\windows\Python\3.11.2\x64
|
||||
cp C:\hostedtoolcache\windows\Python\3.8.2\x64.complete C:\hostedtoolcache\windows\Python\3.11.2\x64.complete
|
||||
displayName: 'Install Python'
|
||||
workingDirectory: $(WORK_DIR)
|
||||
|
||||
- task: UsePythonVersion@0
|
||||
displayName: 'Use Python'
|
||||
inputs:
|
||||
versionSpec: '3.10'
|
||||
versionSpec: '3.11.2'
|
||||
disableDownloadFromRegistry: true
|
||||
|
||||
- script: |
|
||||
@@ -142,7 +142,8 @@ jobs:
|
||||
python -m pip install -r $(REPO_DIR)\src\bindings\python\wheel\requirements-dev.txt
|
||||
python -m pip install -r $(REPO_DIR)\src\bindings\python\requirements.txt
|
||||
rem For running Paddle frontend unit tests
|
||||
python -m pip install -r $(REPO_DIR)\src\frontends\paddle\tests\requirements.txt
|
||||
# TODO Reenable PDPD after paddlepaddle==2.5.0 with compliant protobuf is released (ticket 95904)
|
||||
#python -m pip install -r $(REPO_DIR)\src\frontends\paddle\tests\requirements.txt
|
||||
rem For running ONNX frontend unit tests
|
||||
python -m pip install -r $(REPO_DIR)\src\frontends\onnx\tests\requirements.txt
|
||||
rem For running TensorFlow frontend unit tests
|
||||
@@ -177,9 +178,9 @@ jobs:
|
||||
-DENABLE_PYTHON=ON ^
|
||||
-DBUILD_nvidia_plugin=OFF ^
|
||||
-DCUSTOM_OPERATIONS="calculate_grid;complex_mul;fft;grid_sample;sparse_conv;sparse_conv_transpose" ^
|
||||
-DPYTHON_EXECUTABLE="C:\hostedtoolcache\windows\Python\3.10.7\x64\python.exe" ^
|
||||
-DPYTHON_INCLUDE_DIR="C:\hostedtoolcache\windows\Python\3.10.7\x64\include" ^
|
||||
-DPYTHON_LIBRARY="C:\hostedtoolcache\windows\Python\3.10.7\x64\libs\python310.lib" ^
|
||||
-DPYTHON_EXECUTABLE="C:\hostedtoolcache\windows\Python\3.11.2\x64\python.exe" ^
|
||||
-DPYTHON_INCLUDE_DIR="C:\hostedtoolcache\windows\Python\3.11.2\x64\include" ^
|
||||
-DPYTHON_LIBRARY="C:\hostedtoolcache\windows\Python\3.11.2\x64\libs\python311.lib" ^
|
||||
-DOPENVINO_EXTRA_MODULES=$(OPENVINO_CONTRIB_REPO_DIR)\modules ^
|
||||
-DCMAKE_C_COMPILER:PATH="$(MSVC_COMPILER_PATH)" ^
|
||||
-DCMAKE_CXX_COMPILER:PATH="$(MSVC_COMPILER_PATH)" ^
|
||||
|
||||
@@ -65,11 +65,11 @@ jobs:
|
||||
steps:
|
||||
- task: UsePythonVersion@0
|
||||
inputs:
|
||||
versionSpec: '3.10'
|
||||
versionSpec: '3.11.2'
|
||||
addToPath: true
|
||||
architecture: 'x64'
|
||||
githubToken: $(auth_token)
|
||||
displayName: Setup Python 3.10
|
||||
displayName: Setup Python 3.11
|
||||
name: setupPython
|
||||
|
||||
- script: |
|
||||
|
||||
@@ -27,6 +27,8 @@ elseif(PYTHON_VERSION_MINOR EQUAL 9)
|
||||
set(clang_version 12)
|
||||
elseif(PYTHON_VERSION_MINOR EQUAL 10)
|
||||
set(clang_version 14)
|
||||
elseif(PYTHON_VERSION_MINOR EQUAL 11)
|
||||
set(clang_version 14)
|
||||
else()
|
||||
message(WARNING "Cannot suggest clang package for python ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}")
|
||||
endif()
|
||||
|
||||
@@ -87,9 +87,10 @@ if(ENABLE_TESTS)
|
||||
${ft_out_files}
|
||||
${onnx_fe_out_files})
|
||||
|
||||
if (ENABLE_OV_PADDLE_FRONTEND)
|
||||
add_dependencies(test_model_zoo paddle_test_models)
|
||||
endif()
|
||||
# TODO Reenable PDPD after paddlepaddle==2.5.0 with compliant protobuf is released (ticket 95904)
|
||||
#if (ENABLE_OV_PADDLE_FRONTEND)
|
||||
# add_dependencies(test_model_zoo paddle_test_models)
|
||||
#endif()
|
||||
|
||||
install(DIRECTORY "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test_model_zoo"
|
||||
DESTINATION tests COMPONENT tests EXCLUDE_FROM_ALL)
|
||||
|
||||
@@ -71,7 +71,7 @@ set "PATH=%OPENVINO_LIB_PATHS%;%PATH%"
|
||||
:: Check if Python is installed
|
||||
set PYTHON_VERSION_MAJOR=3
|
||||
set MIN_REQUIRED_PYTHON_VERSION_MINOR=7
|
||||
set MAX_SUPPORTED_PYTHON_VERSION_MINOR=10
|
||||
set MAX_SUPPORTED_PYTHON_VERSION_MINOR=11
|
||||
|
||||
python --version 2>NUL
|
||||
if errorlevel 1 (call :python_not_installed) else (call :check_python_version)
|
||||
|
||||
@@ -101,7 +101,7 @@ fi
|
||||
|
||||
PYTHON_VERSION_MAJOR="3"
|
||||
MIN_REQUIRED_PYTHON_VERSION_MINOR="7"
|
||||
MAX_SUPPORTED_PYTHON_VERSION_MINOR="10"
|
||||
MAX_SUPPORTED_PYTHON_VERSION_MINOR="11"
|
||||
|
||||
check_python_version () {
|
||||
if [ -z "$python_version" ]; then
|
||||
|
||||
@@ -18,6 +18,6 @@ wheel>=0.38.1
|
||||
|
||||
# Frontends
|
||||
docopt~=0.6.2
|
||||
paddlepaddle==2.4.2; python_version<'3.11'
|
||||
paddlepaddle==2.4.2; python_version <= '3.10'
|
||||
tensorflow>=1.15.5,<2.13.0
|
||||
six~=1.16.0
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
add_subdirectory(src)
|
||||
|
||||
if(ENABLE_TESTS)
|
||||
add_subdirectory(tests)
|
||||
endif()
|
||||
# ticket 95904
|
||||
#if(ENABLE_TESTS AND Python_VERSION_MINOR LESS 11)
|
||||
# add_subdirectory(tests)
|
||||
#endif()
|
||||
|
||||
@@ -13,6 +13,7 @@ fastjsonschema~=2.15.1
|
||||
test-generator==0.1.2
|
||||
requests>=2.25.1
|
||||
opencv-python>=4.5
|
||||
paddlepaddle==2.4.2
|
||||
py>=1.9.0
|
||||
pytest>=5.0,<7.3
|
||||
pytest-dependency==0.5.1
|
||||
|
||||
@@ -5,14 +5,14 @@ from pathlib import Path
|
||||
import os
|
||||
import glob
|
||||
import re
|
||||
|
||||
import paddle
|
||||
from paddle.jit import to_static
|
||||
from paddle.static import InputSpec
|
||||
import pytest
|
||||
|
||||
import sys
|
||||
print(sys.path)
|
||||
|
||||
# ticket 95904
|
||||
#import paddle
|
||||
#from paddle.jit import to_static
|
||||
#from paddle.static import InputSpec
|
||||
|
||||
import pytest
|
||||
|
||||
from openvino.frontend import FrontEndManager
|
||||
from openvino.runtime import shutdown
|
||||
@@ -31,26 +31,29 @@ def skip_if_paddle_frontend_is_disabled():
|
||||
pytest.skip()
|
||||
|
||||
|
||||
def create_paddle_model():
|
||||
@to_static()
|
||||
def test(x):
|
||||
return paddle.nn.functional.relu6(x)
|
||||
x_spec = InputSpec(shape=[None, 3], dtype="float32", name="x")
|
||||
paddle.jit.save(test, path=paddle_relu6_model_basename, input_spec=[x_spec, ])
|
||||
# ticket 95904
|
||||
#def create_paddle_model():
|
||||
#@to_static()
|
||||
#def test(x):
|
||||
# return paddle.nn.functional.relu6(x)
|
||||
#x_spec = InputSpec(shape=[None, 3], dtype="float32", name="x")
|
||||
#paddle.jit.save(test, path=paddle_relu6_model_basename, input_spec=[x_spec, ])
|
||||
|
||||
|
||||
def create_concat_model():
|
||||
@to_static()
|
||||
def test(x, y):
|
||||
return paddle.concat([x, y], axis=0)
|
||||
x_spec = InputSpec(shape=[None, 3], dtype="float32", name="x")
|
||||
y_spec = InputSpec(shape=[None, 3], dtype="float32", name="y")
|
||||
paddle.jit.save(test, path=paddle_concat_model_basename, input_spec=[x_spec, y_spec])
|
||||
# ticket 95904
|
||||
#def create_concat_model():
|
||||
#@to_static()
|
||||
#def test(x, y):
|
||||
# return paddle.concat([x, y], axis=0)
|
||||
#x_spec = InputSpec(shape=[None, 3], dtype="float32", name="x")
|
||||
#y_spec = InputSpec(shape=[None, 3], dtype="float32", name="y")
|
||||
#paddle.jit.save(test, path=paddle_concat_model_basename, input_spec=[x_spec, y_spec])
|
||||
|
||||
|
||||
def setup_module():
|
||||
create_paddle_model()
|
||||
create_concat_model()
|
||||
# ticket 95904
|
||||
#def setup_module():
|
||||
#create_paddle_model()
|
||||
#create_concat_model()
|
||||
|
||||
|
||||
def teardown_module():
|
||||
@@ -59,6 +62,7 @@ def teardown_module():
|
||||
shutdown()
|
||||
|
||||
|
||||
@pytest.mark.skip(reason="Paddlepaddle has incompatible protobuf. Ticket: 95904")
|
||||
def test_paddle_conversion_extension():
|
||||
skip_if_paddle_frontend_is_disabled()
|
||||
|
||||
@@ -89,6 +93,7 @@ def test_paddle_conversion_extension():
|
||||
assert invoked
|
||||
|
||||
|
||||
@pytest.mark.skip(reason="Paddlepaddle has incompatible protobuf. Ticket: 95904")
|
||||
def test_op_extension_via_paddle_extension_set_attrs_values():
|
||||
skip_if_paddle_frontend_is_disabled()
|
||||
|
||||
@@ -109,6 +114,7 @@ def test_op_extension_via_paddle_extension_set_attrs_values():
|
||||
assert model
|
||||
|
||||
|
||||
@pytest.mark.skip(reason="Paddlepaddle has incompatible protobuf. Ticket: 95904")
|
||||
def test_op_extension_via_frontend_extension_set_attrs_values():
|
||||
skip_if_paddle_frontend_is_disabled()
|
||||
|
||||
@@ -142,6 +148,7 @@ def get_builtin_extensions_path():
|
||||
raise RuntimeError("Unable to find test_builtin_extensions")
|
||||
|
||||
|
||||
@pytest.mark.skip(reason="Paddlepaddle has incompatible protobuf. Ticket: 95904")
|
||||
def test_so_extension_via_frontend_convert_input_model():
|
||||
skip_if_paddle_frontend_is_disabled()
|
||||
|
||||
@@ -157,6 +164,7 @@ def test_so_extension_via_frontend_convert_input_model():
|
||||
assert all(op.get_type_name() != "Clamp" for op in model.get_ops())
|
||||
|
||||
|
||||
@pytest.mark.skip(reason="Paddlepaddle has incompatible protobuf. Ticket: 95904")
|
||||
def test_so_extension_via_frontend_decode_input_model():
|
||||
skip_if_paddle_frontend_is_disabled()
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
-c ../constraints.txt
|
||||
requests
|
||||
# paddlepaddle # ticket 95904
|
||||
numpy
|
||||
requests
|
||||
torch
|
||||
torchvision
|
||||
paddlepaddle; python_version<'3.11'
|
||||
pytest
|
||||
tensorflow-addons
|
||||
tensorflow-addons; python_version <= '3.10'
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
import numpy as np
|
||||
import pytest
|
||||
import sys
|
||||
from common.layer_test_class import check_ir_version
|
||||
from common.tf_layer_test_class import CommonTFLayerTest
|
||||
from common.utils.tf_utils import permute_nchw_to_nhwc
|
||||
@@ -46,15 +47,65 @@ class TestUnaryOps(CommonTFLayerTest):
|
||||
|
||||
return inputs_dict
|
||||
|
||||
def create_net_with_mish(self, shape, ir_version, use_new_frontend):
|
||||
"""
|
||||
TODO: Move functionality to `create_net_with_unary_op()` once tensorflow_addons
|
||||
supports Python 3.11
|
||||
Tensorflow net IR net
|
||||
|
||||
Input->mish => Input->mish
|
||||
"""
|
||||
import tensorflow as tf
|
||||
import tensorflow_addons as tfa
|
||||
|
||||
tf.compat.v1.reset_default_graph()
|
||||
|
||||
with tf.compat.v1.Session() as sess:
|
||||
tf_x_shape = shape.copy()
|
||||
tf_x_shape = permute_nchw_to_nhwc(tf_x_shape, use_new_frontend)
|
||||
|
||||
input = tf.compat.v1.placeholder(tf.float32, tf_x_shape, 'Input')
|
||||
tfa.activations.mish(input)
|
||||
|
||||
tf.compat.v1.global_variables_initializer()
|
||||
tf_net = sess.graph_def
|
||||
|
||||
#
|
||||
# Create reference IR net
|
||||
# Please, specify 'type': 'Input' for input node
|
||||
# Moreover, do not forget to validate ALL layer attributes!!!
|
||||
#
|
||||
|
||||
ref_net = None
|
||||
|
||||
if check_ir_version(10, None, ir_version) and not use_new_frontend:
|
||||
nodes_attributes = {
|
||||
'input': {'kind': 'op', 'type': 'Parameter'},
|
||||
'input_data': {'shape': shape, 'kind': 'data'},
|
||||
'testing_op': {'kind': 'op', 'type': 'Mish'},
|
||||
'testing_data': {'shape': shape, 'kind': 'data'},
|
||||
'result': {'kind': 'op', 'type': 'Result'}
|
||||
}
|
||||
|
||||
ref_net = build_graph(nodes_attributes,
|
||||
[('input', 'input_data'),
|
||||
('input_data', 'testing_op'),
|
||||
('testing_op', 'testing_data'),
|
||||
('testing_data', 'result')
|
||||
])
|
||||
|
||||
return tf_net, ref_net
|
||||
|
||||
def create_net_with_unary_op(self, shape, ir_version, op_type, use_new_frontend):
|
||||
"""
|
||||
TODO: Move functionality of `create_net_with_mish()` here once tensorflow_addons
|
||||
supports Python 3.11
|
||||
Tensorflow net IR net
|
||||
|
||||
Input->UnaryOp => Input->UnaryOp
|
||||
|
||||
"""
|
||||
import tensorflow as tf
|
||||
import tensorflow_addons as tfa
|
||||
|
||||
self.current_op_type = op_type
|
||||
op_type_to_tf = {
|
||||
@@ -74,7 +125,7 @@ class TestUnaryOps(CommonTFLayerTest):
|
||||
'Floor': tf.math.floor,
|
||||
'Log': tf.math.log,
|
||||
'LogicalNot': tf.math.logical_not,
|
||||
'Mish': tfa.activations.mish,
|
||||
#'Mish': tfa.activations.mish, # temporarily moved to `create_net_with_mish()`
|
||||
'Negative': tf.math.negative,
|
||||
'Sigmoid': tf.nn.sigmoid,
|
||||
'Sign': tf.math.sign,
|
||||
@@ -162,7 +213,6 @@ class TestUnaryOps(CommonTFLayerTest):
|
||||
'LogicalNot',
|
||||
'Square',
|
||||
'Erf',
|
||||
'Mish',
|
||||
])
|
||||
@pytest.mark.precommit
|
||||
def test_unary_op_precommit(self, params, ie_device, precision, ir_version, temp_dir, op_type,
|
||||
@@ -173,6 +223,21 @@ class TestUnaryOps(CommonTFLayerTest):
|
||||
use_new_frontend=use_new_frontend),
|
||||
ie_device, precision, ir_version, temp_dir=temp_dir,
|
||||
use_new_frontend=use_new_frontend, use_old_api=use_old_api)
|
||||
|
||||
@pytest.mark.xfail(sys.version_info > (3, 10), reason="tensorflow_addons package is not available for Python 3.11 and higher")
|
||||
@pytest.mark.parametrize("params", test_data_precommit)
|
||||
@pytest.mark.precommit
|
||||
def test_unary_op_mish_precommit(self, params, ie_device, precision, ir_version, temp_dir,
|
||||
use_new_frontend, use_old_api):
|
||||
"""
|
||||
TODO: Move to `test_unary_op_precommit()` once tensorflow_addons package is available for Python 3.11
|
||||
"""
|
||||
if ie_device == 'GPU':
|
||||
pytest.skip("5D tensors is not supported on GPU")
|
||||
self._test(*self.create_net_with_mish(**params, ir_version=ir_version,
|
||||
use_new_frontend=use_new_frontend),
|
||||
ie_device, precision, ir_version, temp_dir=temp_dir,
|
||||
use_new_frontend=use_new_frontend, use_old_api=use_old_api)
|
||||
|
||||
test_data = [pytest.param(dict(shape=[10, 12]), marks=pytest.mark.precommit_tf_fe),
|
||||
dict(shape=[8, 10, 12]),
|
||||
@@ -206,7 +271,6 @@ class TestUnaryOps(CommonTFLayerTest):
|
||||
'Asinh',
|
||||
'Square',
|
||||
'Erf',
|
||||
'Mish',
|
||||
])
|
||||
@pytest.mark.nightly
|
||||
def test_unary_op(self, params, ie_device, precision, ir_version, temp_dir, op_type,
|
||||
@@ -217,3 +281,18 @@ class TestUnaryOps(CommonTFLayerTest):
|
||||
use_new_frontend=use_new_frontend),
|
||||
ie_device, precision, ir_version, temp_dir=temp_dir,
|
||||
use_new_frontend=use_new_frontend, use_old_api=use_old_api)
|
||||
|
||||
@pytest.mark.xfail(sys.version_info > (3, 10), reason="tensorflow_addons package is not available for Python 3.11 and higher")
|
||||
@pytest.mark.parametrize("params", test_data)
|
||||
@pytest.mark.nightly
|
||||
def test_unary_op_mish(self, params, ie_device, precision, ir_version, temp_dir, op_type,
|
||||
use_new_frontend, use_old_api):
|
||||
"""
|
||||
TODO: Move to `test_unary_op()` once tensorflow_addons package is available for Python 3.11
|
||||
"""
|
||||
if ie_device == 'GPU':
|
||||
pytest.skip("5D tensors is not supported on GPU")
|
||||
self._test(*self.create_net_with_mish(**params, ir_version=ir_version,
|
||||
use_new_frontend=use_new_frontend),
|
||||
ie_device, precision, ir_version, temp_dir=temp_dir,
|
||||
use_new_frontend=use_new_frontend, use_old_api=use_old_api)
|
||||
|
||||
2
thirdparty/open_model_zoo
vendored
2
thirdparty/open_model_zoo
vendored
Submodule thirdparty/open_model_zoo updated: 8cf1844752...ec74a9f08b
@@ -109,6 +109,7 @@ def test_mo_extensions_test():
|
||||
assert not status.returncode
|
||||
|
||||
|
||||
@pytest.mark.skipif(sys.version_info > (3, 10), reason="Ticket: 95904")
|
||||
def test_mo_fallback_test():
|
||||
setup_env()
|
||||
args = [sys.executable, '-m', 'pytest',
|
||||
|
||||
Reference in New Issue
Block a user