首页 Paddle Serving 帖子详情
centous服务器加载YOLO和SSD预测卡死
收藏
快速回复
Paddle Serving 问答Serving 720 3
centous服务器加载YOLO和SSD预测卡死
收藏
快速回复
Paddle Serving 问答Serving 720 3

求大佬解答!!!!

centous服务器上搭建了flask框架的网站,在本地windows的CPU和GPU上均能正常运行。移植到服务器上在执行 preds = ssd_model.predict(photo)的时候会没有返回,调试发现在keras的training下卡在def _predict_loop里batch_outs = f(ins_batch)。移植了YOLO模型后会卡在另外的非项目文件。

加载了其他人的简单模型框架,可以正常运行,区别在卡死模型是load_weights,正常运行的是load_module。

可以运行:

def repredict(filename):
keras.backend.clear_session()
with CustomObjectScope({'relu6': relu6, 'DepthwiseConv2D': DepthwiseConv2D}):
model = load_model("./static/cats_dog_mobileNet.h5")

不可运行SSD:

def detect_image(self, image):
image_shape = np.array(np.shape(image)[0:2])
crop_img, x_offset, y_offset = letterbox_image(image, (self.model_image_size[0], self.model_image_size[1]))
photo = np.array(crop_img, dtype=np.float64)photo = preprocess_input(np.reshape(photo, [1, self.model_image_size[0], self.model_image_size[1], 3]))
with graph.as_default():
preds = self.ssd_model.predict(photo)#卡死

不可运行YOLO:

with graph.as_default():
out_boxes, out_scores, out_classes = self.sess.run(
[self.boxes, self.scores, self.classes],
feed_dict={
self.yolo_model.input: image_data,
self.input_image_shape: [image.size[1], image.size[0]],
# K.learning_phase(): 0
})

0
收藏
回复
全部评论(3)
时间顺序
UnseenMe
#2 回复于2021-05

可以考虑使用Paddle Serving了。

https://github.com/PaddlePaddle/Serving

0
回复
AIStudio810260
#3 回复于2021-05

因为用centos来做深度学习的不多,我猜是不是调用了GPU?

0
回复
AIStudio810260
#4 回复于2021-05
因为用centos来做深度学习的不多,我猜是不是调用了GPU?

看起来yolo和ssd正常跑都需要调用GPU,所以环境安装好了嘛?

0
回复
需求/bug反馈?一键提issue告诉我们
发现bug?如果您知道修复办法,欢迎提pr直接参与建设飞桨~
在@后输入用户全名并按空格结束,可艾特全站任一用户