При преобразовании TF в TRT, читая метафайл, получена ошибка: «Ожидаемый идентификатор или номер, полученный {..», как исправить? - PullRequest
0 голосов
/ 26 марта 2020

Вот мой код:

# has to use this setting to make a session for TensorRT optimization

import tensorflow as tf
import tensorflow.contrib.tensorrt as trt
from tensorflow.python.platform import gfile

# import the meta graph of the tensorflow model
with tf.Session(config=tf.ConfigProto(
                gpu_options=tf.GPUOptions(
                    per_process_gpu_memory_fraction=0.50))) as sess:
    # then, restore the weights to the meta graph. The meta file works in other places!
    saver = tf.train.import_meta_graph(
        "/home/everbiz/AI/project/Tools_Chain/tenorrt/built_graph/tiny-yolo-voc-scott_ng.meta")

Я получаю это сообщение об ошибке

read_meta_graph_file
    raise IOError("Cannot parse file %s: %s." % (filename, str(e)))

OSError: Cannot parse file /home/everbiz/AI/project/Tools_Chain/tenorrt/built_graph/tiny-yolo-voc-scott_ng.meta: 1:1 : '{"random": 1, "anchors": [1.08, 1.19, 3.42, 4.41, 6.63, 11.38, 9.42, 5.11, 16.62, 10.52], "rescore": 1, "out_size": [13, 13, 35], "absolute": 1, "class_scale": 1, "classes": 2, "model": "/home/everbiz/AI/project/Tools_Chain/tenorrt/cfg/tiny-yolo-voc-scott_ng.cfg", "inp_size": [416, 416, 3], "noobject_scale": 1, "colors": [[254.0, 254.0, 254], [222.25, 190.5, 127]], "net": {"width": 416, "saturation": 1.5, "channels": 3, "height": 416, "exposure": 1.5, "decay": 0.0005, "subdivisions": 8, "policy": "steps", "learning_rate": 0.0001, "type": "[net]", "momentum": 0.9, "steps": "-1,100,20000,30000", "batch": 16, "angle": 0, "hue": 0.1, "scales": ".1,10,.1,.1", "max_batches": 40100}, "name": "tiny-yolo-voc-scott_ng", "labels": ["ng", "frame"], "coords": 4, "jitter": 0.2, "softmax": 1, "type": "[region]", "object_scale": 5, "bias_match": 1, "coord_scale": 1, "num": 5, "thresh": 0.5}': Expected identifier or number, got {..
...