[cmake] update paddle inference osx lib (#1859)

* [cmake] update paddle inference osx lib

* Update __init__.py

* Update __init__.py

* Update paddle_inference.cmake

* Update __init__.py
This commit is contained in:
DefTruth
2023-04-24 14:13:15 +08:00
committed by GitHub
parent 652024d2f6
commit 6e5f5f6802
2 changed files with 14 additions and 4 deletions

View File

@@ -46,7 +46,16 @@ if os.name != "nt" and os.path.exists(trt_directory):
# This solution will be removed it when the confilct of paddle and
# fastdeploy is fixed.
try:
import paddle
# import paddle
import platform
sys_platform = platform.platform().lower()
# windows: no conflict between fastdeploy and paddle.
# linux: must import paddle first to solve the conflict.
# macos: still can not solve the conflict between fastdeploy and paddle,
# due to the global flags redefined in paddle/paddle_inference so.
# we got the error (ERROR: flag 'xxx' was defined more than once).
if "linux" in sys_platform:
import paddle
except:
pass