Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
c2804390
P
Paddle
项目概览
PaddlePaddle
/
Paddle
1 年多 前同步成功
通知
2302
Star
20931
Fork
5422
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1423
列表
看板
标记
里程碑
合并请求
543
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1,423
Issue
1,423
列表
看板
标记
里程碑
合并请求
543
合并请求
543
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
c2804390
编写于
6月 07, 2022
作者:
H
heliqi
提交者:
GitHub
6月 08, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Resolve protobuf of ORT Backend conflict (#43275)
解决onnxruntime后端依赖的protobuf跟框架或外部protobuf版本冲突问题
上级
f1b4e4d5
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
71 addition
and
88 deletion
+71
-88
cmake/external/paddle2onnx.cmake
cmake/external/paddle2onnx.cmake
+39
-58
cmake/external/protobuf.cmake
cmake/external/protobuf.cmake
+2
-7
cmake/inference_lib.cmake
cmake/inference_lib.cmake
+3
-9
paddle/fluid/eager/auto_code_generator/CMakeLists.txt
paddle/fluid/eager/auto_code_generator/CMakeLists.txt
+1
-1
paddle/fluid/inference/api/onnxruntime_predictor.cc
paddle/fluid/inference/api/onnxruntime_predictor.cc
+21
-6
paddle/fluid/pybind/CMakeLists.txt
paddle/fluid/pybind/CMakeLists.txt
+1
-1
python/setup.py.in
python/setup.py.in
+4
-6
未找到文件。
cmake/external/paddle2onnx.cmake
浏览文件 @
c2804390
...
@@ -26,74 +26,55 @@ INCLUDE(ExternalProject)
...
@@ -26,74 +26,55 @@ INCLUDE(ExternalProject)
SET
(
PADDLE2ONNX_PROJECT
"extern_paddle2onnx"
)
SET
(
PADDLE2ONNX_PROJECT
"extern_paddle2onnx"
)
SET
(
PADDLE2ONNX_PREFIX_DIR
${
THIRD_PARTY_PATH
}
/paddle2onnx
)
SET
(
PADDLE2ONNX_PREFIX_DIR
${
THIRD_PARTY_PATH
}
/paddle2onnx
)
SET
(
PADDLE2ONNX_INSTALL_DIR
${
THIRD_PARTY_PATH
}
/install/paddle2onnx
)
SET
(
PADDLE2ONNX_INSTALL_DIR
${
THIRD_PARTY_PATH
}
/install/paddle2onnx
)
SET
(
PADDLE2ONNX_SOURCE_DIR
${
THIRD_PARTY_PATH
}
/paddle2onnx/src/
${
PADDLE2ONNX_PROJECT
}
)
SET
(
PADDLE2ONNX_INC_DIR
"
${
PADDLE2ONNX_INSTALL_DIR
}
/include"
CACHE PATH
"paddle2onnx include directory."
FORCE
)
SET
(
PADDLE2ONNX_INC_DIR
"
${
PADDLE2ONNX_INSTALL_DIR
}
/include"
CACHE PATH
"paddle2onnx include directory."
FORCE
)
SET
(
PADDLE2ONNX_
REPOSITORY
${
GIT_URL
}
/PaddlePaddle/Paddle2ONNX.git
)
SET
(
PADDLE2ONNX_
LIB_DIR
SET
(
PADDLE2ONNX_TAG cpp
)
"
${
PADDLE2ONNX_INSTALL_DIR
}
/lib"
SET
(
LIBDIR
"lib"
)
CACHE PATH
"onnxruntime lib directory."
FORCE
)
SET
(
CMAKE_BUILD_RPATH
"
${
CMAKE_BUILD_RPATH
}
"
"
${
PADDLE2ONNX_INSTALL_DIR
}
/
${
LIBDIR
}
"
)
SET
(
CMAKE_BUILD_RPATH
"
${
CMAKE_BUILD_RPATH
}
"
"
${
PADDLE2ONNX_INSTALL_DIR
}
/
${
LIBDIR
}
"
)
INCLUDE_DIRECTORIES
(
${
PADDLE2ONNX_INC_DIR
}
)
# For PADDLE2ONNX code to include internal headers.
INCLUDE_DIRECTORIES
(
${
PADDLE2ONNX_INC_DIR
}
)
# For PADDLE2ONNX code to include internal headers.
if
(
WIN32
)
if
(
WIN32
)
SET
(
PADDLE2ONNX_LIB
"
${
PADDLE2ONNX_INSTALL_DIR
}
/
${
LIBDIR
}
/paddle2onnx.lib"
CACHE FILEPATH
"paddle2onnx static
library."
FORCE
)
SET
(
PADDLE2ONNX_LIB
"
${
PADDLE2ONNX_INSTALL_DIR
}
/
lib/paddle2onnx.dll"
CACHE FILEPATH
"paddle2onnx
library."
FORCE
)
SET
(
PADDLE2ONNX_
SHARED_LIB
"
${
PADDLE2ONNX_INSTALL_DIR
}
/
${
LIBDIR
}
/paddle2onnx.dll"
CACHE FILEPATH
"paddle2onnx shared
library."
FORCE
)
SET
(
PADDLE2ONNX_
COMPILE_LIB
"
${
PADDLE2ONNX_INSTALL_DIR
}
/lib/paddle2onnx.lib"
CACHE FILEPATH
"paddle2onnx compile
library."
FORCE
)
elseif
(
APPLE
)
elseif
(
APPLE
)
SET
(
PADDLE2ONNX_LIB
"
${
PADDLE2ONNX_INSTALL_DIR
}
/
${
LIBDIR
}
/libpaddle2onnx.dylib"
CACHE FILEPATH
"PADDLE2ONNX library."
FORCE
)
SET
(
PADDLE2ONNX_LIB
"
${
PADDLE2ONNX_INSTALL_DIR
}
/lib/libpaddle2onnx.dylib"
CACHE FILEPATH
"PADDLE2ONNX library."
FORCE
)
SET
(
PADDLE2ONNX_COMPILE_LIB
"
${
PADDLE2ONNX_INSTALL_DIR
}
/lib/libpaddle2onnx.dylib"
CACHE FILEPATH
"paddle2onnx compile library."
FORCE
)
else
()
else
()
SET
(
PADDLE2ONNX_LIB
"
${
PADDLE2ONNX_INSTALL_DIR
}
/
${
LIBDIR
}
/libpaddle2onnx.so"
CACHE FILEPATH
"PADDLE2ONNX library."
FORCE
)
SET
(
PADDLE2ONNX_LIB
"
${
PADDLE2ONNX_INSTALL_DIR
}
/lib/libpaddle2onnx.so"
CACHE FILEPATH
"PADDLE2ONNX library."
FORCE
)
SET
(
PADDLE2ONNX_COMPILE_LIB
"
${
PADDLE2ONNX_INSTALL_DIR
}
/lib/libpaddle2onnx.so"
CACHE FILEPATH
"PADDLE2ONNX library."
FORCE
)
endif
(
WIN32
)
endif
(
WIN32
)
if
(
WIN32
)
# The protoc path is required to compile onnx.
set
(
PADDLE2ONNX_URL
string
(
REPLACE
"/"
";"
PROTOC_BIN_PATH
${
PROTOBUF_PROTOC_EXECUTABLE
}
)
"https://github.com/PaddlePaddle/Paddle2ONNX/releases/download/v0.9.7/paddle2onnx-win-x64-0.9.7.zip"
list
(
POP_BACK PROTOC_BIN_PATH
)
list
(
JOIN PROTOC_BIN_PATH
"/"
PROTOC_BIN_PATH
)
set
(
PADDLE2ONNX_OPTIONAL_ARGS
-DCMAKE_CXX_COMPILER=
${
CMAKE_CXX_COMPILER
}
-DCMAKE_C_COMPILER=
${
CMAKE_C_COMPILER
}
-DCMAKE_CXX_FLAGS=
${
CMAKE_CXX_FLAGS
}
-DCMAKE_CXX_STANDARD=11
-DCMAKE_CXX_FLAGS_RELEASE=
${
CMAKE_CXX_FLAGS_RELEASE
}
-DCMAKE_CXX_FLAGS_DEBUG=
${
CMAKE_CXX_FLAGS_DEBUG
}
-DCMAKE_C_FLAGS=
${
CMAKE_C_FLAGS
}
-DCMAKE_C_FLAGS_DEBUG=
${
CMAKE_C_FLAGS_DEBUG
}
-DCMAKE_C_FLAGS_RELEASE=
${
CMAKE_C_FLAGS_RELEASE
}
-DONNX_CUSTOM_PROTOC_PATH=
${
PROTOC_BIN_PATH
}
-DWITH_STATIC=OFF
-DMSVC_STATIC_CRT=
${
MSVC_STATIC_CRT
}
-DCMAKE_INSTALL_PREFIX=
${
PADDLE2ONNX_INSTALL_DIR
}
-DCMAKE_INSTALL_LIBDIR=
${
PADDLE2ONNX_INSTALL_DIR
}
/
${
LIBDIR
}
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
-DCMAKE_BUILD_TYPE=
${
THIRD_PARTY_BUILD_TYPE
}
${
EXTERNAL_OPTIONAL_ARGS
}
)
if
(
WITH_PYTHON
)
set
(
PADDLE2ONNX_OPTIONAL_ARGS
${
PADDLE2ONNX_OPTIONAL_ARGS
}
-DPYTHON_EXECUTABLE:FILEPATH=
${
PYTHON_EXECUTABLE
}
-DPYTHON_INCLUDE_DIR:PATH=
${
PYTHON_INCLUDE_DIR
}
-DPYTHON_LIBRARY:FILEPATH=
${
PYTHON_LIBRARY
}
)
)
endif
()
elseif
(
APPLE
)
set
(
PADDLE2ONNX_URL
"https://github.com/PaddlePaddle/Paddle2ONNX/releases/download/v0.9.7/paddle2onnx-osx-x86_64-0.9.7.tgz"
)
else
()
set
(
PADDLE2ONNX_URL
"https://github.com/PaddlePaddle/Paddle2ONNX/releases/download/v0.9.7/paddle2onnx-linux-x64-0.9.7.tgz"
)
endif
()
ExternalProject_Add
(
ExternalProject_Add
(
${
PADDLE2ONNX_PROJECT
}
${
PADDLE2ONNX_PROJECT
}
${
EXTERNAL_PROJECT_LOG_ARGS
}
${
EXTERNAL_PROJECT_LOG_ARGS
}
${
SHALLOW_CLONE
}
URL
${
PADDLE2ONNX_URL
}
GIT_REPOSITORY
${
PADDLE2ONNX_REPOSITORY
}
PREFIX
${
PADDLE2ONNX_PREFIX_DIR
}
GIT_TAG
${
PADDLE2ONNX_TAG
}
DOWNLOAD_NO_PROGRESS 1
DEPENDS protobuf
CONFIGURE_COMMAND
""
PREFIX
${
PADDLE2ONNX_PREFIX_DIR
}
BUILD_COMMAND
""
UPDATE_COMMAND
""
UPDATE_COMMAND
""
CMAKE_ARGS
${
PADDLE2ONNX_OPTIONAL_ARGS
}
INSTALL_COMMAND
CMAKE_CACHE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=
${
PADDLE2ONNX_INSTALL_DIR
}
${
CMAKE_COMMAND
}
-E copy_directory
${
PADDLE2ONNX_SOURCE_DIR
}
/lib
-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON
${
PADDLE2ONNX_LIB_DIR
}
&&
${
CMAKE_COMMAND
}
-E copy_directory
-DCMAKE_BUILD_TYPE:STRING=
${
THIRD_PARTY_BUILD_TYPE
}
${
PADDLE2ONNX_SOURCE_DIR
}
/include
${
PADDLE2ONNX_INC_DIR
}
BUILD_BYPRODUCTS
${
PADDLE2ONNX_LIB
}
BUILD_BYPRODUCTS
${
PADDLE2ONNX_COMPILE_LIB
}
)
)
ADD_LIBRARY
(
paddle2onnx STATIC IMPORTED GLOBAL
)
add_library
(
paddle2onnx STATIC IMPORTED GLOBAL
)
SET_PROPERTY
(
TARGET paddle2onnx PROPERTY IMPORTED_LOCATION
${
PADDLE2ONNX_LIB
}
)
set_property
(
TARGET paddle2onnx PROPERTY IMPORTED_LOCATION
ADD_DEPENDENCIES
(
paddle2onnx
${
PADDLE2ONNX_PROJECT
}
)
${
PADDLE2ONNX_COMPILE_LIB
}
)
add_dependencies
(
paddle2onnx
${
PADDLE2ONNX_PROJECT
}
)
cmake/external/protobuf.cmake
浏览文件 @
c2804390
...
@@ -199,10 +199,7 @@ FUNCTION(build_protobuf TARGET_NAME BUILD_FOR_HOST)
...
@@ -199,10 +199,7 @@ FUNCTION(build_protobuf TARGET_NAME BUILD_FOR_HOST)
ENDIF
()
ENDIF
()
if
(
WITH_ONNXRUNTIME
)
if
(
WITH_ASCEND AND NOT WITH_ASCEND_CXX11
)
SET
(
PROTOBUF_REPOSITORY
${
GIT_URL
}
/protocolbuffers/protobuf.git
)
SET
(
PROTOBUF_TAG v3.18.0
)
elseif
(
WITH_ASCEND AND NOT WITH_ASCEND_CXX11
)
SET
(
PROTOBUF_REPOSITORY https://gitee.com/tianjianhe/protobuf.git
)
SET
(
PROTOBUF_REPOSITORY https://gitee.com/tianjianhe/protobuf.git
)
SET
(
PROTOBUF_TAG v3.8.0
)
SET
(
PROTOBUF_TAG v3.8.0
)
elseif
(
WITH_ASCEND_CL AND NOT WITH_ASCEND_CXX11
)
elseif
(
WITH_ASCEND_CL AND NOT WITH_ASCEND_CXX11
)
...
@@ -252,9 +249,7 @@ FUNCTION(build_protobuf TARGET_NAME BUILD_FOR_HOST)
...
@@ -252,9 +249,7 @@ FUNCTION(build_protobuf TARGET_NAME BUILD_FOR_HOST)
)
)
ENDFUNCTION
()
ENDFUNCTION
()
if
(
WITH_ONNXRUNTIME
)
if
(
WITH_ASCEND OR WITH_ASCEND_CL
)
SET
(
PROTOBUF_VERSION 3.18.0
)
elseif
(
WITH_ASCEND OR WITH_ASCEND_CL
)
SET
(
PROTOBUF_VERSION 3.8.0
)
SET
(
PROTOBUF_VERSION 3.8.0
)
elseif
(
WITH_IPU
)
elseif
(
WITH_IPU
)
SET
(
PROTOBUF_VERSION 3.6.1
)
SET
(
PROTOBUF_VERSION 3.6.1
)
...
...
cmake/inference_lib.cmake
浏览文件 @
c2804390
...
@@ -121,15 +121,9 @@ function(copy_part_of_thrid_party TARGET DST)
...
@@ -121,15 +121,9 @@ function(copy_part_of_thrid_party TARGET DST)
DSTS
${
dst_dir
}
${
dst_dir
}
)
DSTS
${
dst_dir
}
${
dst_dir
}
)
set
(
dst_dir
"
${
DST
}
/third_party/install/paddle2onnx"
)
set
(
dst_dir
"
${
DST
}
/third_party/install/paddle2onnx"
)
if
(
WIN32
)
copy
(
${
TARGET
}
copy
(
${
TARGET
}
SRCS
${
PADDLE2ONNX_INC_DIR
}
/paddle2onnx
${
PADDLE2ONNX_LIB_DIR
}
SRCS
${
PADDLE2ONNX_INC_DIR
}
/paddle2onnx
${
PADDLE2ONNX_SHARED_LIB
}
${
PADDLE2ONNX_LIB
}
DSTS
${
dst_dir
}
/include
${
dst_dir
}
)
DSTS
${
dst_dir
}
/include
${
dst_dir
}
/lib
${
dst_dir
}
/lib
)
else
()
copy
(
${
TARGET
}
SRCS
${
PADDLE2ONNX_INC_DIR
}
/paddle2onnx
${
PADDLE2ONNX_LIB
}
DSTS
${
dst_dir
}
/include
${
dst_dir
}
/lib
)
endif
()
endif
()
endif
()
set
(
dst_dir
"
${
DST
}
/third_party/install/gflags"
)
set
(
dst_dir
"
${
DST
}
/third_party/install/gflags"
)
...
...
paddle/fluid/eager/auto_code_generator/CMakeLists.txt
浏览文件 @
c2804390
...
@@ -64,7 +64,7 @@ if(WIN32)
...
@@ -64,7 +64,7 @@ if(WIN32)
DEPENDS onnxruntime
)
DEPENDS onnxruntime
)
list
(
APPEND EAGER_CODEGEN_DEPS
${
eager_generator_path
}
/onnxruntime.dll
)
list
(
APPEND EAGER_CODEGEN_DEPS
${
eager_generator_path
}
/onnxruntime.dll
)
ADD_CUSTOM_COMMAND
(
OUTPUT
${
eager_generator_path
}
/paddle2onnx.dll
ADD_CUSTOM_COMMAND
(
OUTPUT
${
eager_generator_path
}
/paddle2onnx.dll
COMMAND
${
CMAKE_COMMAND
}
-E copy
${
PADDLE2ONNX_
SHARED_
LIB
}
${
eager_generator_path
}
COMMAND
${
CMAKE_COMMAND
}
-E copy
${
PADDLE2ONNX_LIB
}
${
eager_generator_path
}
DEPENDS paddle2onnx
)
DEPENDS paddle2onnx
)
list
(
APPEND EAGER_CODEGEN_DEPS
${
eager_generator_path
}
/paddle2onnx.dll
)
list
(
APPEND EAGER_CODEGEN_DEPS
${
eager_generator_path
}
/paddle2onnx.dll
)
endif
()
endif
()
...
...
paddle/fluid/inference/api/onnxruntime_predictor.cc
浏览文件 @
c2804390
...
@@ -74,8 +74,14 @@ bool CheckConvertToONNX(const AnalysisConfig &config) {
...
@@ -74,8 +74,14 @@ bool CheckConvertToONNX(const AnalysisConfig &config) {
config
.
model_dir
(),
config
.
prog_file
(),
config
.
params_file
());
config
.
model_dir
(),
config
.
prog_file
(),
config
.
params_file
());
return
false
;
return
false
;
}
}
return
paddle2onnx
::
IsExportable
(
config
.
prog_file
(),
config
.
params_file
(),
if
(
config
.
model_from_memory
())
{
config
.
model_from_memory
());
return
paddle2onnx
::
IsExportable
(
config
.
prog_file
().
data
(),
config
.
prog_file
().
size
(),
config
.
params_file
().
data
(),
config
.
params_file
().
size
());
}
else
{
return
paddle2onnx
::
IsExportable
(
config
.
prog_file
().
c_str
(),
config
.
params_file
().
c_str
());
}
}
}
bool
ONNXRuntimePredictor
::
Init
()
{
bool
ONNXRuntimePredictor
::
Init
()
{
...
@@ -89,9 +95,16 @@ bool ONNXRuntimePredictor::Init() {
...
@@ -89,9 +95,16 @@ bool ONNXRuntimePredictor::Init() {
place_
=
paddle
::
platform
::
CPUPlace
();
place_
=
paddle
::
platform
::
CPUPlace
();
}
}
std
::
string
onnx_proto
;
char
*
onnx_proto
=
nullptr
;
paddle2onnx
::
Export
(
config_
.
prog_file
(),
config_
.
params_file
(),
&
onnx_proto
,
int
out_size
;
config_
.
model_from_memory
());
if
(
config_
.
model_from_memory
())
{
paddle2onnx
::
Export
(
config_
.
prog_file
().
data
(),
config_
.
prog_file
().
size
(),
config_
.
params_file
().
data
(),
config_
.
params_file
().
size
(),
&
onnx_proto
,
&
out_size
);
}
else
{
paddle2onnx
::
Export
(
config_
.
prog_file
().
c_str
(),
config_
.
params_file
().
c_str
(),
&
onnx_proto
,
&
out_size
);
}
Ort
::
SessionOptions
session_options
;
Ort
::
SessionOptions
session_options
;
if
(
config_
.
ort_optimization_enabled
())
{
if
(
config_
.
ort_optimization_enabled
())
{
...
@@ -118,7 +131,7 @@ bool ONNXRuntimePredictor::Init() {
...
@@ -118,7 +131,7 @@ bool ONNXRuntimePredictor::Init() {
"will be "
"will be "
"generated."
;
"generated."
;
}
}
session_
=
{
env_
,
onnx_proto
.
data
(),
onnx_proto
.
size
(
),
session_options
};
session_
=
{
env_
,
onnx_proto
,
static_cast
<
size_t
>
(
out_size
),
session_options
};
binding_
=
std
::
make_shared
<
Ort
::
IoBinding
>
(
session_
);
binding_
=
std
::
make_shared
<
Ort
::
IoBinding
>
(
session_
);
Ort
::
MemoryInfo
memory_info
(
device_name
,
OrtDeviceAllocator
,
Ort
::
MemoryInfo
memory_info
(
device_name
,
OrtDeviceAllocator
,
...
@@ -153,6 +166,8 @@ bool ONNXRuntimePredictor::Init() {
...
@@ -153,6 +166,8 @@ bool ONNXRuntimePredictor::Init() {
allocator
.
Free
(
output_name
);
allocator
.
Free
(
output_name
);
}
}
delete
onnx_proto
;
onnx_proto
=
nullptr
;
return
true
;
return
true
;
}
}
...
...
paddle/fluid/pybind/CMakeLists.txt
浏览文件 @
c2804390
...
@@ -256,7 +256,7 @@ if(WITH_PYTHON)
...
@@ -256,7 +256,7 @@ if(WITH_PYTHON)
endif
()
endif
()
if
(
WITH_ONNXRUNTIME
)
if
(
WITH_ONNXRUNTIME
)
ADD_CUSTOM_COMMAND
(
OUTPUT
${
CMAKE_CURRENT_BINARY_DIR
}
/paddle2onnx.dll
ADD_CUSTOM_COMMAND
(
OUTPUT
${
CMAKE_CURRENT_BINARY_DIR
}
/paddle2onnx.dll
COMMAND
${
CMAKE_COMMAND
}
-E copy
${
PADDLE2ONNX_
SHARED_
LIB
}
${
CMAKE_CURRENT_BINARY_DIR
}
COMMAND
${
CMAKE_COMMAND
}
-E copy
${
PADDLE2ONNX_LIB
}
${
CMAKE_CURRENT_BINARY_DIR
}
DEPENDS paddle2onnx
)
DEPENDS paddle2onnx
)
list
(
APPEND OP_IMPL_DEPS
${
CMAKE_CURRENT_BINARY_DIR
}
/paddle2onnx.dll
)
list
(
APPEND OP_IMPL_DEPS
${
CMAKE_CURRENT_BINARY_DIR
}
/paddle2onnx.dll
)
list
(
APPEND EAGER_OP_IMPL_DEPS
${
CMAKE_CURRENT_BINARY_DIR
}
/paddle2onnx.dll
)
list
(
APPEND EAGER_OP_IMPL_DEPS
${
CMAKE_CURRENT_BINARY_DIR
}
/paddle2onnx.dll
)
...
...
python/setup.py.in
浏览文件 @
c2804390
...
@@ -528,15 +528,13 @@ if '${WITH_MKLDNN}' == 'ON':
...
@@ -528,15 +528,13 @@ if '${WITH_MKLDNN}' == 'ON':
if '${WITH_ONNXRUNTIME}' == 'ON':
if '${WITH_ONNXRUNTIME}' == 'ON':
shutil.copy('${ONNXRUNTIME_SHARED_LIB}', libs_path)
shutil.copy('${ONNXRUNTIME_SHARED_LIB}', libs_path)
shutil.copy('${PADDLE2ONNX_LIB}', libs_path)
if os.name == 'nt':
if os.name == 'nt':
shutil.copy('${PADDLE2ONNX_SHARED_LIB}', libs_path)
package_data['paddle.libs']+=['paddle2onnx.dll', 'onnxruntime.dll']
package_data['paddle.libs']+=['paddle2onnx.dll', 'onnxruntime.dll']
elif sys.platform == 'darwin':
package_data['paddle.libs']+=['libpaddle2onnx.dylib', 'libonnxruntime.1.10.0.dylib']
else:
else:
shutil.copy('${PADDLE2ONNX_LIB}', libs_path)
package_data['paddle.libs']+=['libpaddle2onnx.so', 'libonnxruntime.so.1.10.0']
if sys.platform == 'darwin':
package_data['paddle.libs']+=['libpaddle2onnx.dylib', 'libonnxruntime.1.10.0.dylib']
else:
package_data['paddle.libs']+=['libpaddle2onnx.so', 'libonnxruntime.so.1.10.0']
if '${WITH_XPU}' == 'ON':
if '${WITH_XPU}' == 'ON':
# only change rpath in Release mode,
# only change rpath in Release mode,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录