未验证 提交 29aebc22 编写于 作者: W Wei Shengyu 提交者: GitHub

Merge pull request #966 from TingquanGao/dev/fix_load_dll

Fix loading dll error in vector_search
......@@ -17,6 +17,7 @@ import paddle
import numpy.ctypeslib as ctl
import numpy as np
import os
import sys
import json
import platform
......@@ -24,13 +25,19 @@ from ctypes import *
from numpy.ctypeslib import ndpointer
__dir__ = os.path.dirname(os.path.abspath(__file__))
winmode = None
if platform.system() == "Windows":
lib_filename = "index.dll"
if sys.version_info.minor >= 8:
winmode = 0x8
else:
lib_filename = "index.so"
so_path = os.path.join(__dir__, lib_filename)
try:
lib = ctypes.cdll.LoadLibrary(so_path)
if winmode is not None:
lib = ctypes.CDLL(so_path, winmode=winmode)
else:
lib = ctypes.CDLL(so_path)
except Exception as ex:
readme_path = os.path.join(__dir__, "README.md")
print(
......
......@@ -87,6 +87,7 @@ wget https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/rec/models/infere
# 下载识别inference模型并解压
wget https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/rec/models/inference/product_ResNet50_vd_aliproduct_v1.0_infer.tar && tar -xf product_ResNet50_vd_aliproduct_v1.0_infer.tar
cd ../
# 下载demo数据并解压
wget https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/rec/data/recognition_demo_data_v1.0.tar && tar -xf recognition_demo_data_v1.0.tar
```
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册