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

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

Tensorflow 對(duì)象檢測(cè) - 將 .pb 文件轉(zhuǎn)換為 tflite

Tensorflow 對(duì)象檢測(cè) - 將 .pb 文件轉(zhuǎn)換為 tflite

胡說(shuō)叔叔 2021-11-16 14:53:40
我嘗試將凍結(jié)的 SSD mobilenet v2 模型轉(zhuǎn)換為 TFLITE 格式以供 Android 使用。這是我所有的步驟:我使用來(lái)自模型動(dòng)物園的ssd_mobilenet_v2_coco_2018_03_29模型使用TF Object Detection API的 train.py 文件重新訓(xùn)練。(好的)使用同樣由 TF Object Detection API 提供的export_inference_graph.py將訓(xùn)練好的 model.ckpt 導(dǎo)出到凍結(jié)的模型文件。(好的)使用 GPU 測(cè)試 Python 中的凍結(jié)圖,并且僅允許使用 CPU。有用。(好的)缺點(diǎn)是,我嘗試使用以下代碼:import tensorflow as tftf.enable_eager_execution()saved_model_dir = 'inference_graph/saved_model/'converter = tf.contrib.lite.TFLiteConverter.from_saved_model(saved_model_dir,input_arrays=input_arrays,output_arrays=output_arrays,input_shapes={"image_tensor": [1, 832, 832, 3]})converter.post_training_quantize = True首先,我嘗試不向函數(shù)添加輸入形狀參數(shù),但沒(méi)有奏效。從那時(shí)起我讀到你可以在那里寫(xiě)任何無(wú)關(guān)緊要的東西。直到這一行的輸出:INFO:tensorflow:Saver not created because there are no variables in the graph to restoreINFO:tensorflow:The specified SavedModel has no variables; no checkpoints were restored.INFO:tensorflow:The given SavedModel MetaGraphDef contains SignatureDefs with the following keys: {'serving_default'}INFO:tensorflow:input tensors info: INFO:tensorflow:Tensor's key in saved_model's tensor_map: inputsINFO:tensorflow: tensor name: image_tensor:0, shape: (-1, -1, -1, 3), type: DT_UINT8INFO:tensorflow:output tensors info: INFO:tensorflow:Tensor's key in saved_model's tensor_map: num_detectionsINFO:tensorflow: tensor name: num_detections:0, shape: (-1), type: DT_FLOATINFO:tensorflow:Tensor's key in saved_model's tensor_map: detection_boxesINFO:tensorflow: tensor name: detection_boxes:0, shape: (-1, 100, 4), type: DT_FLOATINFO:tensorflow:Tensor's key in saved_model's tensor_map: detection_scores我無(wú)法在此處復(fù)制控制臺(tái)輸出,因此它超過(guò)了 30000 個(gè)字符的限制,但您可以在這里看到它:https : //pastebin.com/UyT2x2Vk請(qǐng)?jiān)谶@一點(diǎn)上提供幫助,我該怎么做才能使其正常工作:(我的配置:Ubuntu 16.04,Tensorflow-GPU 1.12
查看完整描述

1 回答

?
白衣染霜花

TA貢獻(xiàn)1796條經(jīng)驗(yàn) 獲得超10個(gè)贊

上周遇到了同樣的問(wèn)題,按照這里描述的步驟解決。

基本上問(wèn)題在于他們的主要腳本不支持 SSD 模型。我不是bazel用來(lái)做這個(gè)的,而是tflite_convert實(shí)用的。

小心使用export_tflite_ssd_graph.py腳本,在使用它之前閱讀它的所有選項(xiàng)(主要是救了我一命的 --max_detections)。

希望這可以幫助。

編輯:您的第 2 步無(wú)效。如果 save_model 包含 SSD,則無(wú)法將其轉(zhuǎn)換為 tflite 模型。您需要使用export_tflite_ssd_graph.py腳本導(dǎo)出經(jīng)過(guò)訓(xùn)練的 model.ckpt并使用.pb創(chuàng)建的文件使用tflite_convert工具將其轉(zhuǎn)換為 tflite 。


查看完整回答
反對(duì) 回復(fù) 2021-11-16
  • 1 回答
  • 0 關(guān)注
  • 374 瀏覽
慕課專(zhuān)欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號(hào)

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