我试着在我的ESP32上运行一些ML,并且我想使用Tensorflow微。但我不太明白,它们是如何形成层层的。下面是如何训练人员检测模型的示例:人检测模型训练
很明显,但最后他们说:
MobileNet v1是由14个具有平均池的深度可分卷积层组成的堆栈,然后是一个完全连通的层,最后是一个软极层。
如果我检查示例代码,其中它们建立了tf lite微观模型,它只有3行:
static tflite::MicroMutableOpResolver<3> micro_op_resolver;
micro_op_resolver.AddAveragePool2D();
micro_op_resolver.AddConv2D();
micro_op_resolver.AddDepthwiseConv2D();有平均池和深度层,但是Conv2D层来自哪里?模型中只显示了一个深度层,但在文档中有14个深度层。
所以问题是,训练模式和我应该建立的张力低的微观模型之间有什么关系吗?如果有,我如何决定如何建立。这就是如果没有关系的问题,我需要以什么方式建立这个模型。
发布于 2020-10-28 12:49:03
它们不显式地构建模型,而是依赖包含体系结构(来源)的模型文件:
model = tflite::GetModel(g_person_detect_model_data);其中,g_person_detect_model_data.cc是使用以下命令从tflite模型(包含体系结构)生成的(参见自述文件中的转换为c#源文件 ):
# Install xxd if it is not available
!apt-get -qq install xxd
# Save the file as a C source file
!xxd -i vww_96_grayscale_quantized.tflite > person_detect_model_data.cc所以你共享的代码没有建立模型。您看到的是,出于性能原因,它们显式地添加了模型所需的操作,而不是依赖更复杂的tflite::AllOpsResolver。这个您共享的代码上面的注释表示:
// Pull in only the operation implementations we need.
// This relies on a complete list of all the ops needed by this graph.
// An easier approach is to just use the AllOpsResolver, but this will
// incur some penalty in code space for op implementations that are not
// needed by this graph.
//
// tflite::AllOpsResolver resolver;
// NOLINTNEXTLINE(runtime-global-variables)
static tflite::MicroMutableOpResolver<5> micro_op_resolver;
micro_op_resolver.AddAveragePool2D();
micro_op_resolver.AddConv2D();
micro_op_resolver.AddDepthwiseConv2D();
micro_op_resolver.AddReshape();
micro_op_resolver.AddSoftmax();https://stackoverflow.com/questions/64572727
复制相似问题