diff --git a/mindspore/lite/build_lite.sh b/mindspore/lite/build_lite.sh index 1531a72c0b3..67a7f7ff91f 100755 --- a/mindspore/lite/build_lite.sh +++ b/mindspore/lite/build_lite.sh @@ -167,10 +167,10 @@ build_lite_jni_and_jar() { } build_python_wheel_package() { - local python_version=`python -V 2>&1 | awk '{print $2}' | awk -F '.' '{print $1}'` + local python_version=`python -V 2>&1 | awk '{print $2}' | awk -F '.' '{print $1}'` || true if [[ "${python_version}" == "3" ]]; then cd ${BASEPATH}/mindspore/lite/build/ - local lite_wrapper_so=`ls python/*.so` + local lite_wrapper_so=`ls python/*.so` || true if [ ! -f "${lite_wrapper_so}" ]; then return 0 fi @@ -194,7 +194,7 @@ build_python_wheel_package() { export TOP_DIR=${BASEPATH} cd package python setup.py bdist_wheel - local minor_version=`python -V 2>&1 | awk '{print $2}' | awk -F '.' '{print $2}'` + local minor_version=`python -V 2>&1 | awk '{print $2}' | awk -F '.' '{print $2}'` || true local py_tags="cp${python_version}${minor_version}-cp${python_version}${minor_version}" if [[ "${minor_version}" == "7" ]]; then py_tags="cp37-cp37m" diff --git a/mindspore/lite/python/CMakeLists.txt b/mindspore/lite/python/CMakeLists.txt index f4ba18e27a7..944f6679bd8 100644 --- a/mindspore/lite/python/CMakeLists.txt +++ b/mindspore/lite/python/CMakeLists.txt @@ -17,12 +17,19 @@ if(Python3_FOUND) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../core/) file(GLOB_RECURSE PY_SRC_LIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.cc") + if(NOT MSLITE_ENABLE_CONVERTER) + file(GLOB_RECURSE CONVERTER_SRC_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "converter_pybind.cc") + list(REMOVE_ITEM PY_SRC_LIST ${CONVERTER_SRC_FILES}) + endif() pybind11_add_module(_c_lite_wrapper NO_EXTRAS ${PY_SRC_LIST}) target_link_libraries(_c_lite_wrapper PRIVATE -Wl,--whole-archive mindspore-lite_static -Wl,--no-whole-archive) if(MSLITE_ENABLE_CONVERTER OR MSLITE_ENABLE_RUNTIME_GLOG) target_link_libraries(_c_lite_wrapper PRIVATE mindspore::glog) endif() + if(MSLITE_ENABLE_CONVERTER) + target_link_libraries(_c_lite_wrapper PRIVATE mindspore_converter) + endif() else() message(WARNING "NumPy not found, so Python API will not be compiled.") endif() diff --git a/mindspore/lite/python/api/model.py b/mindspore/lite/python/api/model.py index d4fa3c2f7d4..9207d8f34c9 100644 --- a/mindspore/lite/python/api/model.py +++ b/mindspore/lite/python/api/model.py @@ -27,6 +27,9 @@ __all__ = ['ModelType', 'Model', 'RunnerConfig', 'ModelParallelRunner'] class ModelType(Enum): + """ + The MoedelType is used to define the model type. + """ MINDIR = 0 MINDIR_LITE = 4