iis服务器助手广告广告
返回顶部
首页 > 资讯 > 后端开发 > Python >tensorflow-model-ser
  • 448
分享到

tensorflow-model-ser

tensorflowmodelser 2023-01-31 06:01:39 448人浏览 安东尼

Python 官方文档:入门教程 => 点击学习

摘要

1、环境说明 ①、操作系统:ubuntu ②、网络要求:需要能够科学上网 2、安装依赖 apt-get install -y python3 build-essential curl libcurl3-dev git libfreetyp

1、环境说明

①、操作系统ubuntu
②、网络要求:需要能够科学上网

2、安装依赖

apt-get install -y python3 build-essential curl libcurl3-dev git libfreetype6-dev libzMQ3-dev pkg-config python3-dev Python3-numpy python3-pip software-properties-common swig zip zlib1g-dev

3、配置python环境

ln -s /usr/bin/python3 /usr/bin/python
ln -s /usr/bin/pip3 /usr/bin/pip

4、安装Tensorflow-serving-api

pip install tensorflow-serving-api

5、配置tensorflow-model-server仓库


echo "deb [arch=amd64] Http://storage.Googleapis.com/tensorflow-serving-apt stable tensorflow-model-server tensorflow-model-server-universal" | tee /etc/apt/sources.list.d/tensorflow-serving.list
curl https://storage.googleapis.com/tensorflow-serving-apt/tensorflow-serving.release.pub.gpg | apt-key add -

6、安装tensorflow-model-server

apt-get remove tensorflow-model-server
apt-get install tensorflow-model-server

7、直接执行tensorflow_model_server命令测试是否安装成功


tensorflow_model_server

Flags:
    --port=8500                         int32   Port to listen on for grpc API
    --rest_api_port=0                   int32   Port to listen on for HTTP/REST API. If set to zero HTTP/REST API will not be exported. This port must be different than the one specified in --port.
    --rest_api_num_threads=32           int32   Number of threads for HTTP/REST API processing. If not set, will be auto set based on number of CPUs.
    --rest_api_timeout_in_ms=30000      int32   Timeout for HTTP/REST API calls.
    --enable_batching=false             bool    enable batching
    --batching_parameters_file=""       string  If non-empty, read an ascii BatchingParameters protobuf from the supplied file name and use the contained values instead of the defaults.
    --model_config_file=""              string  If non-empty, read an ascii ModelServerConfig protobuf from the supplied file name, and serve the models in that file. This config file can be used to specify multiple models to serve and other advanced parameters including non-default version policy. (If used, --model_name, --model_base_path are ignored.)
    --model_name="default"              string  name of model (ignored if --model_config_file flag is set
    --model_base_path=""                string  path to export (ignored if --model_config_file flag is set, otherwise required)
    --file_system_poll_wait_seconds=1   int32   interval in seconds between each poll of the file system for new model version
    --flush_filesystem_caches=true      bool    If true (the default), filesystem caches will be flushed after the initial load of all servables, and after each subsequent individual servable reload (if the number of load threads is 1). This reduces memory consumption of the model server, at the potential cost of cache misses if model files are accessed after servables are loaded.
    --tensorflow_session_parallelism=0  int64   Number of threads to use for running a Tensorflow session. Auto-configured by default.Note that this option is ignored if --platfORM_config_file is non-empty.
    --ssl_config_file=""                string  If non-empty, read an ascii SSLConfig protobuf from the supplied file name and set up a secure grpc channel
    --platform_config_file=""           string  If non-empty, read an ascii PlatformConfigMap protobuf from the supplied file name, and use that platform config instead of the Tensorflow platform. (If used, --enable_batching is ignored.)
    --per_process_gpu_memory_fraction=0.000000  float   Fraction that each process occupies of the GPU memory space the value is between 0.0 and 1.0 (with 0.0 as the default) If 1.0, the server will allocate all the memory when the server starts, If 0.0, Tensorflow will automatically select a value.
    --saved_model_tags="serve"          string  Comma-separated set of tags corresponding to the meta graph def to load from SavedModel.
    --grpc_channel_arguments=""         string  A comma separated list of arguments to be passed to the grpc server. (e.g. grpc.max_connection_age_ms=2000)
    --enable_model_warmup=true          bool    Enables model warmup, which triggers lazy initializations (such as TF optimizations) at load time, to reduce first request latency.

1、安装jdk8

apt-get install openjdk-8-jdk

2、安装bazel编译工具

在包资源中增加Bazel的发布源

echo "deb [arch=amd64] http://storage.googleapis.com/bazel-apt stable jdk1.8" | tee /etc/apt/sources.list.d/bazel.list
curl https://bazel.build/bazel-release.pub.gpg | apt-key add -

安装和更新Bazel

sudo apt-get update && sudo apt-get install bazel
sudo apt-get upgrade bazel

3、clone 代码

git clone https://GitHub.com/tensorflow/serving.git
cd serving

4、安装依赖环境

apt-get install -y \
        build-essential \
        curl \
        libcurl3-dev \
        git \
        libfreetype6-dev \
        libpng12-dev \
        libzmq3-dev \
        pkg-config \
        python-dev \
        python-numpy \
        python-pip \
        software-properties-common \
        swig \
        zip \
        zlib1g-dev

5、 编译安装

bazel build -c opt tensorflow_serving/...

6、 编译完成

二进制文件放在bazel-bin目录下,可以使用如下命令运行:

bazel-bin/tensorflow_serving/model_servers/tensorflow_model_server

7、 测试编译

bazel test -c opt tensorflow_serving/...

--结束END--

本文标题: tensorflow-model-ser

本文链接: https://www.lsjlt.com/news/190354.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
  • tensorflow-model-ser
    1、环境说明 ①、操作系统:ubuntu ②、网络要求:需要能够科学上网 2、安装依赖 apt-get install -y python3 build-essential curl libcurl3-dev git libfreetyp...
    99+
    2023-01-31
    tensorflow model ser
  • SER+FreeRADIUS实现3A
    文档说明 部分内容转自VOIPFC,原文使用的SER版本不是最新的了,我在自己实践的基础上将对文档进行一下完善。 -----------------------------------------   版本历史 2008.11.24 --初...
    99+
    2023-01-31
    SER FreeRADIUS
  • 使用Python写Windows Ser
    1.背景 如果你想用Python开发Windows程序,并让其开机启动等,就必须写成windows的服务程序Windows Service,用Python来做这个事情必须要借助第三方模块pywin32,自己去下载然后安装(注意下载符合...
    99+
    2023-01-31
    Python Windows Ser
  • Python3实现简单的http ser
    前端的开发的html给我们的时候,由于内部有一些ajax请求的.json的数据,需要在一个web server中查看,每次放到http服务器太麻烦。还是直接用python造一个最方便。 最简单的,直接用python3 -m http.se...
    99+
    2023-01-31
    简单 ser http
  • python 搭建简单的http ser
    server: #coding=utf-8 from BaseHTTPServer import BaseHTTPRequestHandler import cgi class PostHandler(BaseHTTPRequestH...
    99+
    2023-01-31
    简单 python ser
  • opencv3.3+TensorFlow
    1、安装Python环境,推荐使用Anaconda,过程不再赘述。2、下载opencv_python3.3.0cp35cp35mwin_amd64.whl或...win32.whl,opencv_python下载地址,下载好后把文件复制到A...
    99+
    2023-01-31
    TensorFlow
  • 安装TensorFlow
    文章目录 1.准备工作2.安装TensorFlow3.激活tensorflow 1.准备工作 在安装TensorFlow之前得先安装Anaconda如果还没有进行安装,可以看我主页安装An...
    99+
    2023-10-12
    tensorflow python 深度学习
  • 什么是v-model
    这篇文章主要介绍“什么是v-model”,在日常操作中,相信很多人在什么是v-model问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”什么是v-model”的疑惑有所帮助!接...
    99+
    2024-04-02
  • 【TensorFlow】01 Tenso
    2018.9.10 一、概述 TF使用数据数据流图进行数值计算,亮点是支持异构设备分布式计算机 常用的ML库有MXNet Torch/Pytorch Theano CNTK Caffe等 0阶张量(纯量),1阶张量(向量),2阶张量(矩...
    99+
    2023-01-31
    TensorFlow Tenso
  • TensorFlow安装
       ···受不了学习的苦,就要受生活的苦··· 包的安装:pip + install + 需要安装的包。 我安装的是 anaconda 环境,所以直接打开 anaconda prompt 工具, pip install tensorfl...
    99+
    2023-01-30
    TensorFlow
  • php-SER-libs-main反序列化靶场通关详细思路
    目录 说明 第一关----基础序列化 第二关----__construct与__destruct 第三关----cookie传参 第四关----create_fucntion 第五关----__wakeup 第六关----私有属性 第七关-...
    99+
    2023-09-23
    php web
  • TensorFlow ImportError: initialization failed
    ImportError: initialization failed 报错内容: D:\Users\Administrator\miniconda3\envs\pynew\lib\site-packages\numpy\core\__in...
    99+
    2023-09-21
    tensorflow python numpy
  • 从 Python到Tensorflow
    最近毕业设计题目是研究对抗样本,要用tensorflow来搭建神经网络,因此python必不可少,这个不是一个传统的Python学习教程只是把学习Python过程中遇到的问题和经验记录下来(基于Python2.7),如果想要一...
    99+
    2023-01-31
    Python Tensorflow
  • ADF Model: DBSequence(讨论一)
    Go to My Oracle Blog刚开始使用ADF的同学基本都会问这样一个问题:以HR schema为例:如果列EMPLOYEE_ID的值由数据库端的Sequence负责产生,并且Sequence由Insert触发器调用,那么在中间层...
    99+
    2023-06-03
  • windows 安装TensorFlow
    我的windows版本是8.1,装了python3.6之后,用pip安装TensorFlow,总是失败: 网上有各种说法,其中一种是更新pip,试了没用。还有一种是查看python版本:如下图,命令行进入python,可以看到是32位的...
    99+
    2023-01-30
    windows TensorFlow
  • Centos7安装Tensorflow
    本文记录了安装过程,为后续重复工作节省时间。有问题请联系zhangtiey@gmail.com 一开始基于python2安装的TensorFlow,后来发现要基于python3,又折腾了一遍。好的地方是基于virtualenv,以前的安装...
    99+
    2023-01-31
    Tensorflow
  • 【TensorFlow 】查看Tensorflow和python对应版本、将现有的TensorFlow更新到指定的版本
    1、查看Tensorflow和python对应版本 1.1这里我是在TensorFlow官方网址产看的 打开官方网址 https://pypi.org/project/tensorflow/1.1.0...
    99+
    2023-09-02
    tensorflow python 深度学习
  • pytorch中model=model.to怎么用
    这篇文章给大家分享的是有关pytorch中model=model.to怎么用的内容。小编觉得挺实用的,因此分享给大家做个参考,一起跟随小编过来看看吧。这代表将模型加载到指定设备上。其中,device=torch.device("c...
    99+
    2023-06-15
  • TensorFlow怎么引用
    这篇“TensorFlow怎么引用”文章的知识点大部分人都不太理解,所以小编给大家总结了以下内容,内容详细,步骤清晰,具有一定的借鉴价值,希望大家阅读完这篇文章能有所收获,下面我们一起来看看这篇“TensorFlow怎么引用”文章吧。imp...
    99+
    2023-06-04
  • 查看Windows下TensorFlow
    查看TensorFlow目前(2018.11.19)对Windows支持的python版本要求 目录 1、查看地址 2、个人总结 3、参考链接 1、查看地址 官网地址:https://pypi.org/project/tensorflow...
    99+
    2023-01-31
    Windows TensorFlow
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作