PaddlePaddle / FastDeploy

⚡️An Easy-to-use and Fast Deep Learning Model Deployment Toolkit for ☁️Cloud 📱Mobile and 📹Edge. Including Image, Video, Text and Audio 20+ main stream scenarios and 150+ SOTA models with end-to-end optimization, multi-platform and multi-framework support.
https://www.paddlepaddle.org.cn/fastdeploy
Apache License 2.0
2.81k stars 441 forks source link

使用人脸识别的时候报错了,TypeError: 'str' object is not callable #1879

Open HiaHong opened 1 year ago

HiaHong commented 1 year ago

Environment

FastDeploy version: e.g 0.8.0 or the latest code in develop branch OS Platform: e.g. Linux x64 / Windows x64 / Mac OSX 12.1(arm or intel) Hardware: e.g. Nvidia GPU 3080Ti CUDA 11.2 CUDNN 8.3 Program Language: e.g. Python 3.8

Problem description

Please attach the log file if there's problem happend. image

python examples\vision\faceid\insightface\python\infer_arcface.py --model ms1mv3_arcface_r100.onnx --face 3.jpg --face_positive h1.jpg --face_negative hyh.jpg --device gpu

报错: [FastDeploy][INFO]: Successfully found CUDA ToolKit from system PATH env -> C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6\bin [INFO] fastdeploy/runtime/runtime.cc(293)::fastdeploy::Runtime::CreateOrtBackend Runtime initialized with Backend::ORT in Device::GPU. FaceRecognitionResult: [Dim(512), Min(-2.607002), Max(2.137851), Mean(0.006605)] FaceRecognitionResult: [Dim(512), Min(-0.931618), Max(1.009867), Mean(-0.024876)] FaceRecognitionResult: [Dim(512), Min(-2.600491), Max(3.553268), Mean(0.038227)] Cosine 01: 0.18622680545915404 Cosine 02: 0.016184934865728532 Traceback (most recent call last): File "examples\vision\faceid\insightface\python\infer_arcface.py", line 81, in print(model.runtime_option) File "D:\anaconda3\envs\paddlex\lib\site-packages\fastdeploy\c_lib_wrap.py", line 176, in RuntimeOptionStr attrs = dir(runtime_option) TypeError: 'str' object is not callable

DefTruth commented 1 year ago

在linux验证是正常的:

(py38) python
Python 3.8.13 (default, Mar 28 2022, 11:38:47)
[GCC 7.5.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import fastdeploy as fd
>>> option = fd.RuntimeOption()
>>> print(option)
RuntimeOption(
  backend : Backend.UNKOWN
  cpu_thread_num : -1
  device : Device.CPU
  device_id : 0
  external_stream : None
  model_file :
  model_format : ModelFormat.PADDLE
  model_from_memory : False
  openvino_option : <fastdeploy.libs.fastdeploy_main.OpenVINOBackendOption object at 0x7f3150077970>
  ort_option : <fastdeploy.libs.fastdeploy_main.OrtBackendOption object at 0x7f3150077970>
  paddle_infer_option : <fastdeploy.libs.fastdeploy_main.PaddleBackendOption object at 0x7f3150077970>
  paddle_lite_option : <fastdeploy.libs.fastdeploy_main.LiteBackendOption object at 0x7f3150077970>
  params_file :
  poros_option : <fastdeploy.libs.fastdeploy_main.PorosBackendOption object at 0x7f3150077970>
  trt_option : <fastdeploy.libs.fastdeploy_main.TrtBackendOption object at 0x7f3150077970>
)

如果影响使用,可以先注释掉这句“print(model.runtime_option)”吧

HiaHong commented 1 year ago

在Linux验证是正常的:

(py38) python
Python 3.8.13 (default, Mar 28 2022, 11:38:47)
[GCC 7.5.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import fastdeploy as fd
>>> option = fd.RuntimeOption()
>>> print(option)
RuntimeOption(
  backend : Backend.UNKOWN
  cpu_thread_num : -1
  device : Device.CPU
  device_id : 0
  external_stream : None
  model_file :
  model_format : ModelFormat.PADDLE
  model_from_memory : False
  openvino_option : <fastdeploy.libs.fastdeploy_main.OpenVINOBackendOption object at 0x7f3150077970>
  ort_option : <fastdeploy.libs.fastdeploy_main.OrtBackendOption object at 0x7f3150077970>
  paddle_infer_option : <fastdeploy.libs.fastdeploy_main.PaddleBackendOption object at 0x7f3150077970>
  paddle_lite_option : <fastdeploy.libs.fastdeploy_main.LiteBackendOption object at 0x7f3150077970>
  params_file :
  poros_option : <fastdeploy.libs.fastdeploy_main.PorosBackendOption object at 0x7f3150077970>
  trt_option : <fastdeploy.libs.fastdeploy_main.TrtBackendOption object at 0x7f3150077970>
)

如果影响使用,可以先注释掉这句“print(model.runtime_option)”吧

image 这个验证我也是通过的,只是infer_arcface.py 进行人脸识别的时候报的错,我也是直接注释了