diff --git a/python/examples/imagenet/README.md b/python/examples/imagenet/README.md index 536440e73ea43f55a4c93bf126d62e86aa3983e6..415818e715e22e97399c710a61f2463fd166bd19 100644 --- a/python/examples/imagenet/README.md +++ b/python/examples/imagenet/README.md @@ -44,6 +44,6 @@ python -m paddle_serving_server_gpu.serve --model ResNet50_vd_model --port 9696 client send inference request ``` -python image_rpc_client.py ResNet50_vd_client_config/serving_client_conf.prototxt +python resnet50_rpc_client.py ResNet50_vd_client_config/serving_client_conf.prototxt ``` *the port of server side in this example is 9696 diff --git a/python/examples/imagenet/README_CN.md b/python/examples/imagenet/README_CN.md index c34ccca32b737467e687dfd5e86c3229f4339075..77ade579ba17ad8247b2f118242642a1d3c79927 100644 --- a/python/examples/imagenet/README_CN.md +++ b/python/examples/imagenet/README_CN.md @@ -44,6 +44,6 @@ python -m paddle_serving_server_gpu.serve --model ResNet50_vd_model --port 9696 client端进行预测 ``` -python image_rpc_client.py ResNet50_vd_client_config/serving_client_conf.prototxt +python resnet50_rpc_client.py ResNet50_vd_client_config/serving_client_conf.prototxt ``` *server端示例中服务端口为9696端口 diff --git a/python/paddle_serving_app/reader/image_reader.py b/python/paddle_serving_app/reader/image_reader.py index a5afb9c84743fe401ab62608b7b38b5ccd6623ae..7988bf447b5a0a075171d93d22dd1933aa8532b8 100644 --- a/python/paddle_serving_app/reader/image_reader.py +++ b/python/paddle_serving_app/reader/image_reader.py @@ -13,14 +13,19 @@ # limitations under the License. import cv2 import os -import urllib import numpy as np import base64 +import sys from . import functional as F from PIL import Image, ImageDraw import json _cv2_interpolation_to_str = {cv2.INTER_LINEAR: "cv2.INTER_LINEAR", None: "None"} +py_version = sys.version_info[0] +if py_version == 2: + import urllib +else: + import urllib.request as urllib def generate_colormap(num_classes): @@ -393,7 +398,7 @@ class Normalize(object): class Lambda(object): """Apply a user-defined lambda as a transform. - Very shame to just copy from + Very shame to just copy from https://github.com/pytorch/vision/blob/master/torchvision/transforms/transforms.py#L301 Args: