OpenVINO开发小组
直播中

张红

7年用户 1264经验值
私信 关注
[问答]

无法将自定义EfficientNetB0模型转换为中间表示(IR)格式怎么处理?

   

  • 该模型是通过使用此代码生成的:model=tf.keras.applications.EfficientNetB0(
        include_top=True,
        weights=None,
        pooling=max,
        classes=2,
        classifier_activation="softmax"
    )
  • 将模型转换为 SavedModel 格式
  • 运行模型优化器命令: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
   
            

回帖(1)

范逊敏

2023-8-15 11:24:20
遇到错误的原因是自定义模型中的某些层与模型优化器架构不兼容。
Open Model Zoo 中经过验证的 英特尔公共预先训练 的 EfficientNet 模型如下:

举报

更多回帖

发帖
×
20
完善资料,
赚取积分