Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/148.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 是否有C+的tf.lite.Interpreter.get#u input#u details的等价物+;?_Python_C++_Python 3.x_Tensorflow_Tensorflow Lite - Fatal编程技术网

Python 是否有C+的tf.lite.Interpreter.get#u input#u details的等价物+;?

Python 是否有C+的tf.lite.Interpreter.get#u input#u details的等价物+;?,python,c++,python-3.x,tensorflow,tensorflow-lite,Python,C++,Python 3.x,Tensorflow,Tensorflow Lite,在TensorFlow lite的Python API中,有一些方法可以检索有关输入和输出张量的详细信息,称为tf.lite.Interpreter.get\u input\u details和tf.lite.Interpreter.get\u output\u details。我是在这些DICT中的“量化”条目之后,它包含平均值和标准偏差的值 在其他平台上部署这些模型时,我使用C++ API来建立解释器。为了准备模型的输入,我还需要均值和标准差 我无法在C++中找到这些函数的等价物。它们存在吗

在TensorFlow lite的Python API中,有一些方法可以检索有关输入和输出张量的详细信息,称为
tf.lite.Interpreter.get\u input\u details
tf.lite.Interpreter.get\u output\u details
。我是在这些DICT中的“量化”条目之后,它包含平均值和标准偏差的值

在其他平台上部署这些模型时,我使用C++ API来建立解释器。为了准备模型的输入,我还需要均值和标准差


<>我无法在C++中找到这些函数的等价物。它们存在吗?

你可以从
TfLiteTensor
结构中得到量化参数,比如

// Get the input tensor indices.
const std::vector<int>& inputs = interpreter->inputs();
// Get the tensor object of the 1st input.
TfLiteTensor* tensor = interpreter->tensor(input[0]);
const TfLiteQuantizationParams& params = tensor->param
//获取输入张量索引。
const std::vector&inputs=解释器->输入();
//获取第一个输入的张量对象。
TfLiteTensor*张量=解释器->张量(输入[0]);
常量TfLiteQuantizationParams¶ms=张量->参数

您也可以使用
printExpressorState()
获取相同的信息,事实上,这是非常令人难以接受的:

tflite::PrintInterpreterState(interpreter.get());

简短的答案是否定的,但是你可以重塑C++中的输入和输出张量。