изменить dtype тензора (из существующей модели) с uint8 на float - PullRequest
0 голосов
/ 20 апреля 2020

привет, я хочу изменить входной тип d для существующей модели с uint8 на float, я загрузил модель, но я не знаю, как изменить входной тип d, пожалуйста, помогите мне

def load( checkpoint_filename, input_name="images",
             output_name="features"):
    session = tf.compat.v1.Session()
    with tf.io.gfile.GFile(checkpoint_filename, "rb") as file_handle:
        graph_def =  tf.compat.v1.GraphDef()
        graph_def.ParseFromString(file_handle.read())
    tf.import_graph_def(graph_def, name="net")
    input_var = tf.compat.v1.get_default_graph().get_tensor_by_name(
        "net/%s:0" % input_name)
    print(input_var.dtype.as_numpy_dtype)
load('./converttf2tflite/mars-small128TOtrt.pb')
...