Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
Paddle
提交
7bb72e37
P
Paddle
项目概览
BaiXuePrincess
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
7bb72e37
编写于
6月 22, 2022
作者:
H
heliqi
提交者:
GitHub
6月 22, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
paddle2onnx update to 0.9.8 (#43742)
上级
2e79f81c
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
76 addition
and
78 deletion
+76
-78
cmake/external/onnxruntime.cmake
cmake/external/onnxruntime.cmake
+18
-8
cmake/external/paddle2onnx.cmake
cmake/external/paddle2onnx.cmake
+51
-26
paddle/fluid/inference/api/demo_ci/CMakeLists.txt
paddle/fluid/inference/api/demo_ci/CMakeLists.txt
+1
-15
paddle/fluid/inference/tests/infer_ut/CMakeLists.txt
paddle/fluid/inference/tests/infer_ut/CMakeLists.txt
+1
-15
paddle/fluid/pybind/CMakeLists.txt
paddle/fluid/pybind/CMakeLists.txt
+4
-11
python/setup.py.in
python/setup.py.in
+1
-3
未找到文件。
cmake/external/onnxruntime.cmake
浏览文件 @
7bb72e37
...
...
@@ -26,6 +26,7 @@ include(ExternalProject)
add_definitions
(
-DPADDLE_WITH_ONNXRUNTIME
)
set
(
ONNXRUNTIME_PROJECT
"extern_onnxruntime"
)
set
(
ONNXRUNTIME_VERSION
"1.10.0"
)
set
(
ONNXRUNTIME_PREFIX_DIR
${
THIRD_PARTY_PATH
}
/onnxruntime
)
set
(
ONNXRUNTIME_SOURCE_DIR
${
THIRD_PARTY_PATH
}
/onnxruntime/src/
${
ONNXRUNTIME_PROJECT
}
)
...
...
@@ -40,21 +41,29 @@ set(CMAKE_BUILD_RPATH "${CMAKE_BUILD_RPATH}" "${ONNXRUNTIME_LIB_DIR}")
if
(
WIN32
)
set
(
ONNXRUNTIME_URL
"https://github.com/microsoft/onnxruntime/releases/download/v
1.10.0/onnxruntime-win-x64-1.10.0
.zip"
"https://github.com/microsoft/onnxruntime/releases/download/v
${
ONNXRUNTIME_VERSION
}
/onnxruntime-win-x64-
${
ONNXRUNTIME_VERSION
}
.zip"
)
elseif
(
APPLE
)
set
(
ONNXRUNTIME_URL
"https://github.com/microsoft/onnxruntime/releases/download/v
1.10.0/onnxruntime-osx-x86_64-1.10.0
.tgz"
"https://github.com/microsoft/onnxruntime/releases/download/v
${
ONNXRUNTIME_VERSION
}
/onnxruntime-osx-x86_64-
${
ONNXRUNTIME_VERSION
}
.tgz"
)
else
()
set
(
ONNXRUNTIME_URL
"https://github.com/microsoft/onnxruntime/releases/download/v
1.10.0/onnxruntime-linux-x64-1.10.0
.tgz"
"https://github.com/microsoft/onnxruntime/releases/download/v
${
ONNXRUNTIME_VERSION
}
/onnxruntime-linux-x64-
${
ONNXRUNTIME_VERSION
}
.tgz"
)
endif
()
# For ONNXRUNTIME code to include internal headers.
include_directories
(
${
ONNXRUNTIME_INC_DIR
}
)
set
(
ONNXRUNTIME_LIB_NEW_NAME
"libonnxruntime
${
CMAKE_SHARED_LIBRARY_SUFFIX
}
"
)
if
(
APPLE
)
set
(
ONNXRUNTIME_LIB_NAME
"libonnxruntime.
${
ONNXRUNTIME_VERSION
}${
CMAKE_SHARED_LIBRARY_SUFFIX
}
"
)
else
()
set
(
ONNXRUNTIME_LIB_NAME
"libonnxruntime
${
CMAKE_SHARED_LIBRARY_SUFFIX
}
.
${
ONNXRUNTIME_VERSION
}
"
)
endif
()
if
(
WIN32
)
set
(
ONNXRUNTIME_SOURCE_LIB
"
${
ONNXRUNTIME_SOURCE_DIR
}
/lib/onnxruntime.dll"
...
...
@@ -67,20 +76,20 @@ if(WIN32)
CACHE FILEPATH
"ONNXRUNTIME static library."
FORCE
)
elseif
(
APPLE
)
set
(
ONNXRUNTIME_SOURCE_LIB
"
${
ONNXRUNTIME_SOURCE_DIR
}
/lib/
libonnxruntime.1.10.0.dylib
"
"
${
ONNXRUNTIME_SOURCE_DIR
}
/lib/
${
ONNXRUNTIME_LIB_NAME
}
"
CACHE FILEPATH
"ONNXRUNTIME source library."
FORCE
)
set
(
ONNXRUNTIME_LIB
"
${
ONNXRUNTIME_INSTALL_DIR
}
/lib/
libonnxruntime.1.10.0.dylib
"
"
${
ONNXRUNTIME_INSTALL_DIR
}
/lib/
${
ONNXRUNTIME_LIB_NAME
}
"
CACHE FILEPATH
"ONNXRUNTIME static library."
FORCE
)
set
(
ONNXRUNTIME_SHARED_LIB
${
ONNXRUNTIME_LIB
}
CACHE FILEPATH
"ONNXRUNTIME shared library."
FORCE
)
else
()
set
(
ONNXRUNTIME_SOURCE_LIB
"
${
ONNXRUNTIME_SOURCE_DIR
}
/lib/
libonnxruntime.so.1.10.0
"
"
${
ONNXRUNTIME_SOURCE_DIR
}
/lib/
${
ONNXRUNTIME_LIB_NAME
}
"
CACHE FILEPATH
"ONNXRUNTIME source library."
FORCE
)
set
(
ONNXRUNTIME_LIB
"
${
ONNXRUNTIME_INSTALL_DIR
}
/lib/
libonnxruntime.so.1.10.0
"
"
${
ONNXRUNTIME_INSTALL_DIR
}
/lib/
${
ONNXRUNTIME_LIB_NAME
}
"
CACHE FILEPATH
"ONNXRUNTIME static library."
FORCE
)
set
(
ONNXRUNTIME_SHARED_LIB
${
ONNXRUNTIME_LIB
}
...
...
@@ -117,7 +126,8 @@ else()
INSTALL_COMMAND
${
CMAKE_COMMAND
}
-E copy
${
ONNXRUNTIME_SOURCE_LIB
}
${
ONNXRUNTIME_LIB
}
&&
${
CMAKE_COMMAND
}
-E copy_directory
${
ONNXRUNTIME_SOURCE_DIR
}
/include
${
ONNXRUNTIME_INC_DIR
}
${
ONNXRUNTIME_INC_DIR
}
&&
${
CMAKE_COMMAND
}
-E create_symlink
${
ONNXRUNTIME_LIB_NAME
}
${
ONNXRUNTIME_LIB_DIR
}
/
${
ONNXRUNTIME_LIB_NEW_NAME
}
BUILD_BYPRODUCTS
${
ONNXRUNTIME_LIB
}
)
endif
()
...
...
cmake/external/paddle2onnx.cmake
浏览文件 @
7bb72e37
...
...
@@ -24,6 +24,7 @@ endif()
include
(
ExternalProject
)
set
(
PADDLE2ONNX_PROJECT
"extern_paddle2onnx"
)
set
(
PADDLE2ONNX_VERSION
"0.9.8"
)
set
(
PADDLE2ONNX_PREFIX_DIR
${
THIRD_PARTY_PATH
}
/paddle2onnx
)
set
(
PADDLE2ONNX_SOURCE_DIR
${
THIRD_PARTY_PATH
}
/paddle2onnx/src/
${
PADDLE2ONNX_PROJECT
}
)
...
...
@@ -38,6 +39,15 @@ set(CMAKE_BUILD_RPATH "${CMAKE_BUILD_RPATH}" "${PADDLE2ONNX_LIB_DIR}")
# For PADDLE2ONNX code to include internal headers.
include_directories
(
${
PADDLE2ONNX_INC_DIR
}
)
set
(
PADDLE2ONNX_LIB_NEW_NAME
"libpaddle2onnx
${
CMAKE_SHARED_LIBRARY_SUFFIX
}
"
)
if
(
APPLE
)
set
(
PADDLE2ONNX_LIB_NAME
"libpaddle2onnx.
${
PADDLE2ONNX_VERSION
}${
CMAKE_SHARED_LIBRARY_SUFFIX
}
"
)
else
()
set
(
PADDLE2ONNX_LIB_NAME
"libpaddle2onnx
${
CMAKE_SHARED_LIBRARY_SUFFIX
}
.
${
PADDLE2ONNX_VERSION
}
"
)
endif
()
if
(
WIN32
)
set
(
PADDLE2ONNX_LIB
"
${
PADDLE2ONNX_INSTALL_DIR
}
/lib/paddle2onnx.dll"
...
...
@@ -45,50 +55,65 @@ if(WIN32)
set
(
PADDLE2ONNX_COMPILE_LIB
"
${
PADDLE2ONNX_INSTALL_DIR
}
/lib/paddle2onnx.lib"
CACHE FILEPATH
"paddle2onnx compile library."
FORCE
)
elseif
(
APPLE
)
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
()
set
(
PADDLE2ONNX_SOURCE_LIB
"
${
PADDLE2ONNX_SOURCE_DIR
}
/lib/
${
PADDLE2ONNX_LIB_NAME
}
"
CACHE FILEPATH
"PADDLE2ONNX source library."
FORCE
)
set
(
PADDLE2ONNX_LIB
"
${
PADDLE2ONNX_
INSTALL_DIR
}
/lib/libpaddle2onnx.so
"
"
${
PADDLE2ONNX_
LIB_DIR
}
/
${
PADDLE2ONNX_LIB_NAME
}
"
CACHE FILEPATH
"PADDLE2ONNX library."
FORCE
)
set
(
PADDLE2ONNX_COMPILE_LIB
"
${
PADDLE2ONNX_INSTALL_DIR
}
/lib/libpaddle2onnx.so"
${
PADDLE2ONNX_LIB
}
CACHE FILEPATH
"paddle2onnx compile library."
FORCE
)
endif
()
if
(
WIN32
)
set
(
PADDLE2ONNX_URL
"https://github.com/PaddlePaddle/Paddle2ONNX/releases/download/v
0.9.7/paddle2onnx-win-x64-0.9.7
.zip"
"https://github.com/PaddlePaddle/Paddle2ONNX/releases/download/v
${
PADDLE2ONNX_VERSION
}
/paddle2onnx-win-x64-
${
PADDLE2ONNX_VERSION
}
.zip"
)
elseif
(
APPLE
)
set
(
PADDLE2ONNX_URL
"https://github.com/PaddlePaddle/Paddle2ONNX/releases/download/v
0.9.7/paddle2onnx-osx-x86_64-0.9.7
.tgz"
"https://github.com/PaddlePaddle/Paddle2ONNX/releases/download/v
${
PADDLE2ONNX_VERSION
}
/paddle2onnx-osx-x86_64-
${
PADDLE2ONNX_VERSION
}
.tgz"
)
else
()
set
(
PADDLE2ONNX_URL
"https://github.com/PaddlePaddle/Paddle2ONNX/releases/download/v
0.9.7/paddle2onnx-linux-x64-0.9.7
.tgz"
"https://github.com/PaddlePaddle/Paddle2ONNX/releases/download/v
${
PADDLE2ONNX_VERSION
}
/paddle2onnx-linux-x64-
${
PADDLE2ONNX_VERSION
}
.tgz"
)
endif
()
ExternalProject_Add
(
${
PADDLE2ONNX_PROJECT
}
${
EXTERNAL_PROJECT_LOG_ARGS
}
URL
${
PADDLE2ONNX_URL
}
PREFIX
${
PADDLE2ONNX_PREFIX_DIR
}
DOWNLOAD_NO_PROGRESS 1
CONFIGURE_COMMAND
""
BUILD_COMMAND
""
UPDATE_COMMAND
""
INSTALL_COMMAND
${
CMAKE_COMMAND
}
-E copy_directory
${
PADDLE2ONNX_SOURCE_DIR
}
/lib
${
PADDLE2ONNX_LIB_DIR
}
&&
${
CMAKE_COMMAND
}
-E copy_directory
${
PADDLE2ONNX_SOURCE_DIR
}
/include
${
PADDLE2ONNX_INC_DIR
}
BUILD_BYPRODUCTS
${
PADDLE2ONNX_COMPILE_LIB
}
)
if
(
WIN32
)
ExternalProject_Add
(
${
PADDLE2ONNX_PROJECT
}
${
EXTERNAL_PROJECT_LOG_ARGS
}
URL
${
PADDLE2ONNX_URL
}
PREFIX
${
PADDLE2ONNX_PREFIX_DIR
}
DOWNLOAD_NO_PROGRESS 1
CONFIGURE_COMMAND
""
BUILD_COMMAND
""
UPDATE_COMMAND
""
INSTALL_COMMAND
${
CMAKE_COMMAND
}
-E copy_directory
${
PADDLE2ONNX_SOURCE_DIR
}
/lib
${
PADDLE2ONNX_LIB_DIR
}
&&
${
CMAKE_COMMAND
}
-E copy_directory
${
PADDLE2ONNX_SOURCE_DIR
}
/include
${
PADDLE2ONNX_INC_DIR
}
BUILD_BYPRODUCTS
${
PADDLE2ONNX_COMPILE_LIB
}
)
else
()
ExternalProject_Add
(
${
PADDLE2ONNX_PROJECT
}
${
EXTERNAL_PROJECT_LOG_ARGS
}
URL
${
PADDLE2ONNX_URL
}
PREFIX
${
PADDLE2ONNX_PREFIX_DIR
}
DOWNLOAD_NO_PROGRESS 1
CONFIGURE_COMMAND
""
BUILD_COMMAND
""
UPDATE_COMMAND
""
INSTALL_COMMAND
${
CMAKE_COMMAND
}
-E copy
${
PADDLE2ONNX_SOURCE_LIB
}
${
PADDLE2ONNX_COMPILE_LIB
}
&&
${
CMAKE_COMMAND
}
-E copy_directory
${
PADDLE2ONNX_SOURCE_DIR
}
/include
${
PADDLE2ONNX_INC_DIR
}
&&
${
CMAKE_COMMAND
}
-E create_symlink
${
PADDLE2ONNX_LIB_NAME
}
${
PADDLE2ONNX_LIB_DIR
}
/
${
PADDLE2ONNX_LIB_NEW_NAME
}
BUILD_BYPRODUCTS
${
PADDLE2ONNX_COMPILE_LIB
}
)
endif
()
add_library
(
paddle2onnx STATIC IMPORTED GLOBAL
)
set_property
(
TARGET paddle2onnx PROPERTY IMPORTED_LOCATION
...
...
paddle/fluid/inference/api/demo_ci/CMakeLists.txt
浏览文件 @
7bb72e37
...
...
@@ -189,21 +189,7 @@ else()
endif
()
if
(
WITH_ONNXRUNTIME
)
if
(
WIN32
)
set
(
DEPS
${
DEPS
}
${
PADDLE_LIB_THIRD_PARTY_PATH
}
onnxruntime/lib/onnxruntime.lib
paddle2onnx
)
elseif
(
APPLE
)
set
(
DEPS
${
DEPS
}
${
PADDLE_LIB_THIRD_PARTY_PATH
}
onnxruntime/lib/libonnxruntime.1.10.0.dylib
paddle2onnx
)
else
()
set
(
DEPS
${
DEPS
}
${
PADDLE_LIB_THIRD_PARTY_PATH
}
onnxruntime/lib/libonnxruntime.so.1.10.0
paddle2onnx
)
endif
()
set
(
DEPS
${
DEPS
}
onnxruntime paddle2onnx
)
endif
()
if
(
NOT WIN32
)
...
...
paddle/fluid/inference/tests/infer_ut/CMakeLists.txt
浏览文件 @
7bb72e37
...
...
@@ -214,21 +214,7 @@ else()
endif
()
if
(
WITH_ONNXRUNTIME
)
if
(
WIN32
)
set
(
DEPS
${
DEPS
}
${
PADDLE_LIB_THIRD_PARTY_PATH
}
onnxruntime/lib/onnxruntime.lib
paddle2onnx
)
elseif
(
APPLE
)
set
(
DEPS
${
DEPS
}
${
PADDLE_LIB_THIRD_PARTY_PATH
}
onnxruntime/lib/libonnxruntime.1.10.0.dylib
paddle2onnx
)
else
()
set
(
DEPS
${
DEPS
}
${
PADDLE_LIB_THIRD_PARTY_PATH
}
onnxruntime/lib/libonnxruntime.so.1.10.0
paddle2onnx
)
endif
()
set
(
DEPS
${
DEPS
}
onnxruntime paddle2onnx
)
endif
()
if
(
NOT WIN32
)
...
...
paddle/fluid/pybind/CMakeLists.txt
浏览文件 @
7bb72e37
...
...
@@ -380,17 +380,10 @@ if(WITH_PYTHON)
# LD_LIBRARY_PATH. This is different with Windows platformm, which search
# *.dll in current directory automatically.
if
(
WITH_ONNXRUNTIME
)
if
(
APPLE
)
set
(
PADDLE2ONNX_PYBIND_OUT
${
CMAKE_CURRENT_BINARY_DIR
}
/libpaddle2onnx.dylib
)
set
(
ONNXRUNTIME_PYBIND_OUT
${
CMAKE_CURRENT_BINARY_DIR
}
/libonnxruntime.1.10.0.dylib
)
else
()
set
(
PADDLE2ONNX_PYBIND_OUT
${
CMAKE_CURRENT_BINARY_DIR
}
/libpaddle2onnx.so
)
set
(
ONNXRUNTIME_PYBIND_OUT
${
CMAKE_CURRENT_BINARY_DIR
}
/libonnxruntime.so.1.10.0
)
endif
()
set
(
PADDLE2ONNX_PYBIND_OUT
${
CMAKE_CURRENT_BINARY_DIR
}
/
${
PADDLE2ONNX_LIB_NAME
}
)
set
(
ONNXRUNTIME_PYBIND_OUT
${
CMAKE_CURRENT_BINARY_DIR
}
/
${
ONNXRUNTIME_LIB_NAME
}
)
add_custom_command
(
OUTPUT
${
PADDLE2ONNX_PYBIND_OUT
}
...
...
python/setup.py.in
浏览文件 @
7bb72e37
...
...
@@ -538,10 +538,8 @@ if '${WITH_ONNXRUNTIME}' == 'ON':
shutil.copy('${PADDLE2ONNX_LIB}', libs_path)
if os.name == 'nt':
package_data['paddle.libs']+=['paddle2onnx.dll', 'onnxruntime.dll']
elif 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
']
package_data['paddle.libs']+=['
${PADDLE2ONNX_LIB_NAME}', '${ONNXRUNTIME_LIB_NAME}
']
if '${WITH_XPU}' == 'ON':
# only change rpath in Release mode,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录