經過驗證的 EfficientNet 型號由 OpenVINO™ 支援。
- 使用此代碼產生此模型:
model=tf.keras.applications.EfficientNetB0(
include_top=True,
weights=None,
pooling=max,
classes=2,
classifier_activation="softmax"
)
- 將模型轉換為已保存的模式格式
- 執行模型優化程式命令:
mo --saved_model_dir model
- 收到錯誤:
[ ERROR ] Cannot infer shapes or values for node "StatefulPartitionedCall".
[ ERROR ] Error converting shape to a TensorShape: Failed to convert 'masked_array(data=[--, 224, 224, 3],
mask=[ True, False, False, False],
fill_value=-1000000007)' to a shape: 'masked'could not be converted to a dimension. A shape should either be single dimension (e.g. 10), or an iterable of dimensions (e.g. [1, 10, None])..
[ ERROR ]
[ ERROR ] It can happen due to bug in custom shape infer function .
[ ERROR ] Or because the node inputs have incorrect values/shapes.
[ ERROR ] Or because input shapes are incorrect (embedded to the model or passed via --input_shape).
[ ERROR ] Run Model Optimizer with --log_level=DEBUG for more information.
[ ERROR ] Exception occurred during running replacer "REPLACEMENT_ID" (): Stopped shape/value propagation at "StatefulPartitionedCall" node.
For more information please refer to Model Optimizer FAQ, question #38. (https://docs.openvino.ai/latest/openvino_docs_MO_DG_prepare_model_Model_Optimizer_FAQ.html?question=38#question-38) Post Time
遇到的錯誤是由於自訂模型中的某些層與 Model Optimizer 架構不相容。
Open Model Zoo 經過驗證 的 Intel 公共預先訓練效率 網路模型如下: