第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

使用 tensorflow serve 為經(jīng)過(guò)訓(xùn)練的對(duì)象檢測(cè)模型提供服務(wù)

使用 tensorflow serve 為經(jīng)過(guò)訓(xùn)練的對(duì)象檢測(cè)模型提供服務(wù)

湖上湖 2021-06-01 20:28:36
我很難為 tensorflow 模型提供服務(wù),我已經(jīng)使用 tensorflow 的對(duì)象檢測(cè) API 從預(yù)訓(xùn)練模型訓(xùn)練了該模型。我已經(jīng)用model_main.py腳本訓(xùn)練了一個(gè)模型 (Resnet101),性能似乎可以用于生產(chǎn)。因此,我創(chuàng)建了一個(gè)運(yùn)行 tensorflow-serve 的 docker 容器。我設(shè)法為在訓(xùn)練過(guò)程結(jié)束時(shí)創(chuàng)建的模型提供服務(wù)。我猜這個(gè)功能是新的,但似乎model_main.py腳本servable在訓(xùn)練結(jié)束時(shí)創(chuàng)建了一個(gè)。(我在“train_dir”中找到了一個(gè)名為“export”的新文件夾,其中包含 asaved_model.pb和 thevariables variables.data-00000-of-00001和variables.index)。但是,我已經(jīng)設(shè)法為這個(gè)模型提供服務(wù),輸出形式tensorflow_model_server如下所示:2018-08-29 07:47:50.268810: I tensorflow_serving/core/loader_harness.cc:86] Successfully loaded servable version {name: my_model version: 123}2018-08-29 07:47:50.271480: I tensorflow_serving/model_servers/main.cc:327] Running ModelServer at 0.0.0.0:8500 ...所以服務(wù)似乎有效。問(wèn)題是,我正在努力使用 python 客戶端連接到服務(wù)器。我修改了 tensorflow serve inception 示例附帶的客戶端文件,如下所示:from __future__ import print_function# This is a placeholder for a Google-internal import.import grpcimport tensorflow as tffrom tensorflow_serving.apis import predict_pb2from tensorflow_serving.apis import prediction_service_pb2_grpctf.app.flags.DEFINE_string('server', 'localhost:9000',                       'PredictionService host:port')tf.app.flags.DEFINE_string('image', '', 'path to image in JPEG format')FLAGS = tf.app.flags.FLAGSdef main(_):  channel = grpc.insecure_channel(FLAGS.server)  stub = prediction_service_pb2_grpc.PredictionServiceStub(channel)  # Send request  with open(FLAGS.image, 'rb') as f:    # See prediction_service.proto for gRPC request/response details.    data = f.read()如果我使用正確設(shè)置的端口運(yùn)行此腳本,則會(huì)從模型服務(wù)器內(nèi)部收到錯(cuò)誤消息:2018-08-29 08:32:48.426016: W external/org_tensorflow/tensorflow/core/framework/op_kernel.cc:1275] OP_REQUIRES failed at example_parsing_ops.cc:240 : Invalid argument: Could not parse example input, value: '????客戶端返回一些隨機(jī)的二進(jìn)制字符串。但顯然存在連接并且請(qǐng)求到達(dá)服務(wù)器。在我看來(lái),客戶的請(qǐng)求有問(wèn)題,但我不知道如何正確設(shè)置。我沒(méi)有找到有關(guān)默認(rèn)簽名密鑰的任何信息,該model_main.py腳本用于導(dǎo)出經(jīng)過(guò)訓(xùn)練的模型并嘗試使用訓(xùn)練檢查點(diǎn)創(chuàng)建新的可服務(wù)對(duì)象,但修改后的exporter.py腳本失敗。在這種情況下,有人知道如何正確設(shè)置客戶的請(qǐng)求嗎?
查看完整描述

2 回答

  • 2 回答
  • 0 關(guān)注
  • 237 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)