diff --git a/cmake/paddle_inference.cmake b/cmake/paddle_inference.cmake index 1aad4dfda..476a66c72 100755 --- a/cmake/paddle_inference.cmake +++ b/cmake/paddle_inference.cmake @@ -99,12 +99,13 @@ else() elseif(APPLE) if(CURRENT_OSX_ARCH MATCHES "arm64") message(FATAL_ERROR "Paddle Backend doesn't support Mac OSX with Arm64 now.") + set(PADDLEINFERENCE_FILE "paddle_inference-osx-arm64-openblas-0.0.0.660f781b77.tgz") else() # TODO(qiuyanjun): Should remove this old paddle inference lib - set(PADDLEINFERENCE_FILE "paddle_inference-osx-x86_64-2.4-dev3.tgz") - # TODO(qiuyanjun): Should use the commit id to tag the version - set(PADDLEINFERENCE_VERSION "2.4-dev3") + # set(PADDLEINFERENCE_FILE "paddle_inference-osx-x86_64-2.4-dev3.tgz") + set(PADDLEINFERENCE_FILE "paddle_inference-osx-x86_64-openblas-0.0.0.660f781b77.tgz") endif() + set(PADDLEINFERENCE_VERSION "0.0.0.660f781b77") else() # Linux with x86 CPU/Arm CPU/GPU/IPU ... if(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "aarch64") diff --git a/python/fastdeploy/__init__.py b/python/fastdeploy/__init__.py index e865b07d8..07f6c9b6a 100755 --- a/python/fastdeploy/__init__.py +++ b/python/fastdeploy/__init__.py @@ -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