本地能跑的paddle预测程序部署到阿里云ubuntu上时报错:You could check whether you killed PaddlePaddle thread/process accidentally or report the case to PaddlePaddle
Created by: zt991211
PaddlePaddle版本:1.8.0 python版本:3.7 使用gunicorn+flask部署paddlepaddle @app.route('/predict/') def prediction(name): path=basedir+'\static\img\'+name+'.png' img1=Image.open(path) org_ROI,ROI_PT=get_ROI_region(img1) img = [] img.append(transform_img(np.array(ROI_PT))) img = np.array(img).astype('float32') place = fluid.CPUPlace() exe = fluid.Executor(place) in_var = img program, feed_vars, fetch_vars = fluid.io.load_inference_model('weights\mnet_model\home\aistudio\work\mnet_model', executor=exe) fetch = exe.run(program, feed={feed_vars[0]: in_var}, fetch_list=fetch_vars) out10 = fetch[4] out10 = np.reshape(out10, (out10.shape[1], out10.shape[2], out10.shape[3])) out10 = np.transpose(out10, (1, 2, 0)) disc_map = np.array(Image.fromarray(out10[:, :, 0]).resize((600, 600))) cup_map = np.array(Image.fromarray(out10[:, :, 1]).resize((600, 600))) disc_map[-round(DiscROI_size / 3):, :] = 0 cup_map[-round(DiscROI_size / 2):, :] = 0 De_disc_map = cv2.linearPolar(rotate(disc_map, 90), (DiscROI_size / 2, DiscROI_size / 2), DiscROI_size / 2, cv2.WARP_FILL_OUTLIERS + cv2.WARP_INVERSE_MAP) De_cup_map = cv2.linearPolar(rotate(cup_map, 90), (DiscROI_size / 2, DiscROI_size / 2), DiscROI_size / 2, cv2.WARP_FILL_OUTLIERS + cv2.WARP_INVERSE_MAP) ret, De_cup_map = cv2.threshold(De_cup_map, 0.5, 1, cv2.THRESH_BINARY) res, De_disc_map = cv2.threshold(De_disc_map, 0.5, 1, cv2.THRESH_BINARY) disc_h, disc_w = getCDR(De_disc_map) cup_h, cup_w = getCDR(De_cup_map) V_cdr=cup_h * 1.00 / disc_h W_cdr=cup_w * 1.00/ disc_w res=make_response(jsonify({"VCDR":str(V_cdr), "WCDR":str(W_cdr)})) res.headers['Access-Control-Allow-Origin'] = '*' return res 本地能跑上给出结果,但部署到阿里云服务器上时,一直报错,paddle进程一直被杀死