paddlehub调用GPU报错
Created by: yousong1992
欢迎您反馈PaddleHub使用问题,非常感谢您对PaddleHub的贡献! 在留下您的问题时,辛苦您同步提供如下信息:
- 版本、环境信息 1)PaddleHub和PaddlePaddle版本:请提供您的PaddleHub和PaddlePaddle版本号,例如PaddleHub1.4.1,PaddlePaddle1.6.2 2)系统环境:请您描述系统类型,例如Linux/Windows/MacOS/,python版本
- 复现信息:如为报错,请给出复现环境、复现步骤 paddlehub1.7.1 paddlepaddle-gpu 1.8.1post107, win10 python3.6 报错信息为: File "C:/project/Dlib_face_recognition_from_camera-master/re_get_face.py", line 103, in process result = mask_detector.face_detection(img_list,use_gpu=True) File "C:\Users\dltbj.paddlehub\modules\pyramidbox_lite_server_mask\module.py", line 127, in face_detection images, paths, use_gpu, use_multi_scale): File "C:\Users\dltbj.paddlehub\modules\pyramidbox_lite_server_mask\data_feed.py", line 202, in reader confs_threshold=confs_threshold) File "C:\Users\dltbj.paddlehub\modules\pyramidbox_lite_server\module.py", line 106, in face_detection ]) if use_gpu else self.cpu_predictor.run([image_tensor]) File "C:\Users\dltbj\AppData\Local\Programs\Python\Python36\lib\site-packages\paddle\fluid\dygraph\layers.py", line 533, in getattr return object.getattribute(self, name) AttributeError: 'PyramidBoxLiteServer' object has no attribute 'gpu_predictor' 不明白为什么,我另一个代码用了同样的调用方式,是可以使用GPU的说明环境应该没有问题。 报错代码为: cam_url = 'rtsp://admin:12345@192.168.1.64:554/h264/ch1/main/av_stream' cap = cv2.VideoCapture(cam_url) while True: img_list = [] flag, img_rd = cap.read()# Get camera video stream img_list.append(img_rd) kk = cv2.waitKey(1) result = mask_detector.face_detection(img_list,use_gpu=True) faces = []