Skip to content

  • 体验新版
    • 正在加载...
  • 登录
  • PaddlePaddle
  • Serving
  • Issue
  • #840

S
Serving
  • 项目概览

PaddlePaddle / Serving
大约 2 年 前同步成功

通知 187
Star 833
Fork 253
  • 代码
    • 文件
    • 提交
    • 分支
    • Tags
    • 贡献者
    • 分支图
    • Diff
  • Issue 105
    • 列表
    • 看板
    • 标记
    • 里程碑
  • 合并请求 10
  • Wiki 2
    • Wiki
  • 分析
    • 仓库
    • DevOps
  • 项目成员
  • Pages
S
Serving
  • 项目概览
    • 项目概览
    • 详情
    • 发布
  • 仓库
    • 仓库
    • 文件
    • 提交
    • 分支
    • 标签
    • 贡献者
    • 分支图
    • 比较
  • Issue 105
    • Issue 105
    • 列表
    • 看板
    • 标记
    • 里程碑
  • 合并请求 10
    • 合并请求 10
  • Pages
  • 分析
    • 分析
    • 仓库分析
    • DevOps
  • Wiki 2
    • Wiki
  • 成员
    • 成员
  • 收起侧边栏
  • 动态
  • 分支图
  • 创建新Issue
  • 提交
  • Issue看板
已关闭
开放中
Opened 9月 16, 2020 by saxon_zh@saxon_zhGuest

client_seving显示图像太大(3,225,225)

Created by: stidk

W0916 11:52:00.469072 6493 redis_protocol.cpp:69] No corresponding PipelinedInfo in socket E0916 11:52:00.469117 6493 input_messenger.cpp:113] A message from 127.0.0.1:9292(protocol=esp) is bigger than 536870912 bytes, the connection will be closed. Set max_body_size to allow bigger messages W0916 11:52:00.469156 6493 input_messenger.cpp:276] Close fd=4 SocketId=1@127.0.0.1:9292@51838: too big data W0916 11:52:00.469290 6460 predictor.hpp:129] inference call failed, message: [E22]1/1 channels failed, fail_limit=1 [C0][E22]Close fd=4 SocketId=1@127.0.0.1:9292@51838: too big data 但是我看别人的也是这么搞得,别人还是(3,640,640)的图片都没报图片太大。为什么我就报错了呢

! LD_LIBRARY_PATH=/home/aistudio/env/cuda-9.0/lib64:$LD_LIBRARY_PATH &&
python -m paddle_serving_server_gpu.serve --model uci_car_model --port 9292 --name uci --gpu_id 0(运行serving服务)

from paddle_serving_client import Client import cv2 import numpy as np

client = Client() client.load_client_config("uci_car_client/serving_client_conf.prototxt") client.connect(["127.0.0.1:9292"]) def transform_img(img): # 将图片尺寸缩放道 224x224 img = cv2.resize(img, (224, 224)) # 读入的图像数据格式是[H, W, C] # 使用转置操作将其变成[C, H, W] img = np.transpose(img, (2,0,1)) img = img.astype('float32') # 将数据范围调整到[-1.0, 1.0]之间 img = img / 255. img = img * 2.0 - 1.0 return img def read_img(file_name): # filepath = os.path.join(datadir, name) img = cv2.imread(file_name) # print(img) img = transform_img(img) return img data = read_img('6/16c547f-1c20fa9a74ee4ba2acb152fbddd0a2d5-front.jpg') print(data.shape,data.dtype,data) fetch_map = client.predict(feed={"x": data}, fetch=["type"]) print(fetch_map) (client运行文件)

feed_var { name: "img" alias_name: "x" is_lod_tensor: false feed_type: 1 shape: 3 shape: 224 shape: 224 } fetch_var { name: "fc_2.tmp_2" alias_name: "type" is_lod_tensor: false fetch_type: 1 shape: 2 } (serving_client_conf.prototxt文件)

! LD_LIBRARY_PATH=/home/aistudio/env/cuda-9.0/lib64:$LD_LIBRARY_PATH &&
python -m paddle_serving_server_gpu.serve --model uci_car_model --port 9292 --name uci --gpu_id 0 --max_body_size 100000000000000000 (设置max_body_size的值,报错依然不变)

指派人
分配到
无
里程碑
无
分配里程碑
工时统计
无
截止日期
无
标识: paddlepaddle/Serving#840
渝ICP备2023009037号

京公网安备11010502055752号

网络110报警服务 Powered by GitLab CE v13.7
开源知识
Git 入门 Pro Git 电子书 在线学 Git
Markdown 基础入门 IT 技术知识开源图谱
帮助
使用手册 反馈建议 博客
《GitCode 隐私声明》 《GitCode 服务条款》 关于GitCode
Powered by GitLab CE v13.7