Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/313.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/tensorflow/5.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 训练期间Tensorflow目标检测API mnaspfn头部半错误_Python_Tensorflow_Object Detection Api - Fatal编程技术网

Python 训练期间Tensorflow目标检测API mnaspfn头部半错误

Python 训练期间Tensorflow目标检测API mnaspfn头部半错误,python,tensorflow,object-detection-api,Python,Tensorflow,Object Detection Api,我目前正在尝试使用tf对象检测API训练一个迁移学习模型。 我从Tensorflow中选择了ssd\u mobilenet\u v2\u mnasfpn\u coco。 我安装了所有依赖项,并使用文档中的python文件对其进行了测试 在过去,我训练了一个不同的模型,这是可行的,但我在最终运行一个模型时遇到了一些困难。我在某些方面取得了成功,并使用了与现在相同的训练命令集 但是,当我通过以下方式为我的mnaspfn模型运行训练/图形创建(用于将其转换为tflite模型)时: python对象检测

我目前正在尝试使用tf对象检测API训练一个迁移学习模型。 我从Tensorflow中选择了ssd\u mobilenet\u v2\u mnasfpn\u coco。 我安装了所有依赖项,并使用文档中的python文件对其进行了测试

在过去,我训练了一个不同的模型,这是可行的,但我在最终运行一个模型时遇到了一些困难。我在某些方面取得了成功,并使用了与现在相同的训练命令集

但是,当我通过以下方式为我的mnaspfn模型运行训练/图形创建(用于将其转换为tflite模型)时:

python对象检测/legacy/train.py
python对象检测/导出\u tflite\u ssd\u graph.py
我收到以下错误/警告:

>     WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/tf_slim/layers/layers.py:1089:
> Layer.apply (from tensorflow.python.keras.engine.base_layer) is
> deprecated and will be removed in a future version. Instructions for
> updating: Please use `layer.__call__` method instead. W0628
> 11:19:43.432508 140522432427904 deprecation.py:323] From
> /usr/local/lib/python3.6/dist-packages/tf_slim/layers/layers.py:1089:
> Layer.apply (from tensorflow.python.keras.engine.base_layer) is
> deprecated and will be removed in a future version. Instructions for
> updating: Please use `layer.__call__` method instead.
> ERROR:tensorflow:C6: Tensor("FeatureExtractor/MnasFPN/Identity:0",
> shape=(1, 5, 5, 48), dtype=float32) E0628 11:19:45.003035
> 140522432427904 ssd_mobilenet_v2_mnasfpn_feature_extractor.py:396] C6:
> Tensor("FeatureExtractor/MnasFPN/Identity:0", shape=(1, 5, 5, 48),
> dtype=float32) ERROR:tensorflow:layer_1:
> Tensor("FeatureExtractor/MobilenetV2/Conv/Relu6:0", shape=(1, 160,
> 160, 32), dtype=float32) E0628 11:19:45.003337 140522432427904
> ssd_mobilenet_v2_mnasfpn_feature_extractor.py:396] layer_1:
> Tensor("FeatureExtractor/MobilenetV2/Conv/Relu6:0", shape=(1, 160,
> 160, 32), dtype=float32) ERROR:tensorflow:layer_10:
> Tensor("FeatureExtractor/MobilenetV2/expanded_conv_8/output:0",
> shape=(1, 20, 20, 64), dtype=float32) E0628 11:19:45.003476
> 140522432427904 ssd_mobilenet_v2_mnasfpn_feature_extractor.py:396]
> layer_10:
> Tensor("FeatureExtractor/MobilenetV2/expanded_conv_8/output:0",
> shape=(1, 20, 20, 64), dtype=float32)
> ERROR:tensorflow:layer_10/depthwise_output:
> Tensor("FeatureExtractor/MobilenetV2/expanded_conv_8/depthwise_output:0",
> shape=(1, 20, 20, 384), dtype=float32) E0628 11:19:45.003618
> 140522432427904 ssd_mobilenet_v2_mnasfpn_feature_extractor.py:396]
> layer_10/depthwise_output:
> Tensor("FeatureExtractor/MobilenetV2/expanded_conv_8/depthwise_output:0",
> shape=(1, 20, 20, 384), dtype=float32)
> ERROR:tensorflow:layer_10/expansion_output:
> Tensor("FeatureExtractor/MobilenetV2/expanded_conv_8/expansion_output:0",
> shape=(1, 20, 20, 384), dtype=float32) E0628 11:19:45.003799
> 140522432427904 ssd_mobilenet_v2_mnasfpn_feature_extractor.py:396]
> layer_10/expansion_output:
> Tensor("FeatureExtractor/MobilenetV2/expanded_conv_8/expansion_output:0",
> shape=(1, 20, 20, 384), dtype=float32)
> ERROR:tensorflow:layer_10/output:
> Tensor("FeatureExtractor/MobilenetV2/expanded_conv_8/output:0",
> shape=(1, 20, 20, 64), dtype=float32) E0628 11:19:45.003912
> 140522432427904 ssd_mobilenet_v2_mnasfpn_feature_extractor.py:396]
> layer_10/output:
> Tensor("FeatureExtractor/MobilenetV2/expanded_conv_8/output:0",
> shape=(1, 20, 20, 64), dtype=float32) ERROR:tensorflow:layer_11:
> Tensor("FeatureExtractor/MobilenetV2/expanded_conv_9/output:0",
> shape=(1, 20, 20, 64), dtype=float32) E0628 11:19:45.004024
> 140522432427904 ssd_mobilenet_v2_mnasfpn_feature_extractor.py:396]
> layer_11:
> Tensor("FeatureExtractor/MobilenetV2/expanded_conv_9/output:0",
> shape=(1, 20, 20, 64), dtype=float32)
> ERROR:tensorflow:layer_11/depthwise_output:
> Tensor("FeatureExtractor/MobilenetV2/expanded_conv_9/depthwise_output:0",
> shape=(1, 20, 20, 384), dtype=float32) E0628 11:19:45.004132
> 140522432427904 ssd_mobilenet_v2_mnasfpn_feature_extractor.py:396]
> layer_11/depthwise_output:
> Tensor("FeatureExtractor/MobilenetV2/expanded_conv_9/depthwise_output:0",
> shape=(1, 20, 20, 384), dtype=float32)
> ERROR:tensorflow:layer_11/expansion_output:
> Tensor("FeatureExtractor/MobilenetV2/expanded_conv_9/expansion_output:0",
> shape=(1, 20, 20, 384), dtype=float32) E0628 11:19:45.004241
> 140522432427904 ssd_mobilenet_v2_mnasfpn_feature_extractor.py:396]
> layer_11/expansion_output:
> Tensor("FeatureExtractor/MobilenetV2/expanded_conv_9/expansion_output:0",
> shape=(1, 20, 20, 384), dtype=float32)
> ERROR:tensorflow:layer_11/output:
> Tensor("FeatureExtractor/MobilenetV2/expanded_conv_9/output:0",
> shape=(1, 20, 20, 64), dtype=float32) E0628 11:19:45.004343
> 140522432427904 ssd_mobilenet_v2_mnasfpn_feature_extractor.py:396]
> layer_11/output:
> Tensor("FeatureExtractor/MobilenetV2/expanded_conv_9/output:0",
> shape=(1, 20, 20, 64), dtype=float32) ERROR:tensorflow:layer_12:
> Tensor("FeatureExtractor/MobilenetV2/expanded_conv_10/output:0",
> shape=(1, 20, 20, 96), dtype=float32) E0628 11:19:45.004450
> 140522432427904 ssd_mobilenet_v2_mnasfpn_feature_extractor.py:396]
> layer_12:
> Tensor("FeatureExtractor/MobilenetV2/expanded_conv_10/output:0",
> shape=(1, 20, 20, 96), dtype=float32)
> ERROR:tensorflow:layer_12/depthwise_output:
> Tensor("FeatureExtractor/MobilenetV2/expanded_conv_10/depthwise_output:0",
> shape=(1, 20, 20, 384), dtype=float32) E0628 11:19:45.004577
> 140522432427904 ssd_mobilenet_v2_mnasfpn_feature_extractor.py:396]
> layer_12/depthwise_output:
> Tensor("FeatureExtractor/MobilenetV2/expanded_conv_10/depthwise_output:0",
> shape=(1, 20, 20, 384), dtype=float32)
> ERROR:tensorflow:layer_12/expansion_output:
> Tensor("FeatureExtractor/MobilenetV2/expanded_conv_10/expansion_output:0",
> shape=(1, 20, 20, 384), dtype=float32) E0628 11:19:45.004697
> 140522432427904 ssd_mobilenet_v2_mnasfpn_feature_extractor.py:396]
> layer_12/expansion_output:
> Tensor("FeatureExtractor/MobilenetV2/expanded_conv_10/expansion_output:0",
> shape=(1, 20, 20, 384), dtype=float32)
> ERROR:tensorflow:layer_12/output:
> Tensor("FeatureExtractor/MobilenetV2/expanded_conv_10/output:0",
> shape=(1, 20, 20, 96), dtype=float32) E0628 11:19:45.004810
> 140522432427904 ssd_mobilenet_v2_mnasfpn_feature_extractor.py:396]
> layer_12/output:
> Tensor("FeatureExtractor/MobilenetV2/expanded_conv_10/output:0",
> shape=(1, 20, 20, 96), dtype=float32) ERROR:tensorflow:layer_13:
> Tensor("FeatureExtractor/MobilenetV2/expanded_conv_11/output:0",
> shape=(1, 20, 20, 96), dtype=float32) E0628 11:19:45.004933
> 140522432427904 ssd_mobilenet_v2_mnasfpn_feature_extractor.py:396]
> layer_13:
> Tensor("FeatureExtractor/MobilenetV2/expanded_conv_11/output:0",
> shape=(1, 20, 20, 96), dtype=float32)
> ERROR:tensorflow:layer_13/depthwise_output:
> Tensor("FeatureExtractor/MobilenetV2/expanded_conv_11/depthwise_output:0",
> shape=(1, 20, 20, 576), dtype=float32) E0628 11:19:45.005046
> 140522432427904 ssd_mobilenet_v2_mnasfpn_feature_extractor.py:396]
> layer_13/depthwise_output:
> Tensor("FeatureExtractor/MobilenetV2/expanded_conv_11/depthwise_output:0",
> shape=(1, 20, 20, 576), dtype=float32)
> ERROR:tensorflow:layer_13/expansion_output:
> Tensor("FeatureExtractor/MobilenetV2/expanded_conv_11/expansion_output:0",
> shape=(1, 20, 20, 576), dtype=float32) E0628 11:19:45.005153
> 140522432427904 ssd_mobilenet_v2_mnasfpn_feature_extractor.py:396]
> layer_13/expansion_output:
> Tensor("FeatureExtractor/MobilenetV2/expanded_conv_11/expansion_output:0",
> shape=(1, 20, 20, 576), dtype=float32)
> ERROR:tensorflow:layer_13/output:
> Tensor("FeatureExtractor/MobilenetV2/expanded_conv_11/output:0",
> shape=(1, 20, 20, 96), dtype=float32) E0628 11:19:45.005253
> 140522432427904 ssd_mobilenet_v2_mnasfpn_feature_extractor.py:396]
> layer_13/output:
> Tensor("FeatureExtractor/MobilenetV2/expanded_conv_11/output:0",
> shape=(1, 20, 20, 96), dtype=float32) ERROR:tensorflow:layer_14:
> Tensor("FeatureExtractor/MobilenetV2/expanded_conv_12/output:0",
> shape=(1, 20, 20, 96), dtype=float32) E0628 11:19:45.005365
> 140522432427904 ssd_mobilenet_v2_mnasfpn_feature_extractor.py:396]
> layer_14:
> Tensor("FeatureExtractor/MobilenetV2/expanded_conv_12/output:0",
> shape=(1, 20, 20, 96), dtype=float32)
> ERROR:tensorflow:layer_14/depthwise_output:
> Tensor("FeatureExtractor/MobilenetV2/expanded_conv_12/depthwise_output:0",
> shape=(1, 20, 20, 576), dtype=float32) E0628 11:19:45.005474
> 140522432427904 ssd_mobilenet_v2_mnasfpn_feature_extractor.py:396]
> layer_14/depthwise_output:
> Tensor("FeatureExtractor/MobilenetV2/expanded_conv_12/depthwise_output:0",
> shape=(1, 20, 20, 576), dtype=float32)
> ERROR:tensorflow:layer_14/expansion_output:
> Tensor("FeatureExtractor/MobilenetV2/expanded_conv_12/expansion_output:0",
> shape=(1, 20, 20, 576), dtype=float32) E0628 11:19:45.005624
> 140522432427904 ssd_mobilenet_v2_mnasfpn_feature_extractor.py:396]
> layer_14/expansion_output:
> Tensor("FeatureExtractor/MobilenetV2/expanded_conv_12/expansion_output:0",
> shape=(1, 20, 20, 576), dtype=float32)
> ERROR:tensorflow:layer_14/output:
> Tensor("FeatureExtractor/MobilenetV2/expanded_conv_12/output:0",
> shape=(1, 20, 20, 96), dtype=float32) E0628 11:19:45.005737
> 140522432427904 ssd_mobilenet_v2_mnasfpn_feature_extractor.py:396]
> layer_14/output:
> Tensor("FeatureExtractor/MobilenetV2/expanded_conv_12/output:0",
> shape=(1, 20, 20, 96), dtype=float32) ERROR:tensorflow:layer_15:
> Tensor("FeatureExtractor/MobilenetV2/expanded_conv_13/output:0",
> shape=(1, 10, 10, 160), dtype=float32) E0628 11:19:45.005845
> 140522432427904 ssd_mobilenet_v2_mnasfpn_feature_extractor.py:396]
> layer_15:
> Tensor("FeatureExtractor/MobilenetV2/expanded_conv_13/output:0",
> shape=(1, 10, 10, 160), dtype=float32)
> ERROR:tensorflow:layer_15/depthwise_output:
> Tensor("FeatureExtractor/MobilenetV2/expanded_conv_13/depthwise_output:0",
> shape=(1, 10, 10, 576), dtype=float32) E0628 11:19:45.005954
> 140522432427904 ssd_mobilenet_v2_mnasfpn_feature_extractor.py:396]
> layer_15/depthwise_output:
> Tensor("FeatureExtractor/MobilenetV2/expanded_conv_13/depthwise_output:0",
> shape=(1, 10, 10, 576), dtype=float32)
> ERROR:tensorflow:layer_15/expansion_output:
> Tensor("FeatureExtractor/MobilenetV2/expanded_conv_13/expansion_output:0",
> shape=(1, 20, 20, 576), dtype=float32) E0628 11:19:45.006059
> 140522432427904 ssd_mobilenet_v2_mnasfpn_feature_extractor.py:396]
> layer_15/expansion_output:
> Tensor("FeatureExtractor/MobilenetV2/expanded_conv_13/expansion_output:0",
> shape=(1, 20, 20, 576), dtype=float32)
> [...]
> ERROR:tensorflow:layer_9/depthwise_output:
> Tensor("FeatureExtractor/MobilenetV2/expanded_conv_7/depthwise_output:0",
> shape=(1, 20, 20, 384), dtype=float32) E0628 11:19:45.103541
> 140522432427904 ssd_mobilenet_v2_mnasfpn_feature_extractor.py:396]
> layer_9/depthwise_output:
> Tensor("FeatureExtractor/MobilenetV2/expanded_conv_7/depthwise_output:0",
> shape=(1, 20, 20, 384), dtype=float32)
> ERROR:tensorflow:layer_9/expansion_output:
> Tensor("FeatureExtractor/MobilenetV2/expanded_conv_7/expansion_output:0",
> shape=(1, 20, 20, 384), dtype=float32) E0628 11:19:45.103683
> 140522432427904 ssd_mobilenet_v2_mnasfpn_feature_extractor.py:396]
> layer_9/expansion_output:
> Tensor("FeatureExtractor/MobilenetV2/expanded_conv_7/expansion_output:0",
> shape=(1, 20, 20, 384), dtype=float32)
> ERROR:tensorflow:layer_9/output:
> Tensor("FeatureExtractor/MobilenetV2/expanded_conv_7/output:0",
> shape=(1, 20, 20, 64), dtype=float32) E0628 11:19:45.103810
> 140522432427904 ssd_mobilenet_v2_mnasfpn_feature_extractor.py:396]
> layer_9/output:
> Tensor("FeatureExtractor/MobilenetV2/expanded_conv_7/output:0",
> shape=(1, 20, 20, 64), dtype=float32) 2020-06-28 11:19:48.728455: I
> tensorflow/stream_executor/platform/default/dso_loader.cc:44]
> Successfully opened dynamic library libcuda.so.1 2020-06-28
> 11:19:48.732131: E tensorflow/stream_executor/cuda/cuda_driver.cc:318]
> failed call to cuInit: CUDA_ERROR_NO_DEVICE: no CUDA-capable device is
> detected 2020-06-28 11:19:48.732181: I
> tensorflow/stream_executor/cuda/cuda_diagnostics.cc:156] kernel driver
> does not appear to be running on this host (bf80455718a0):
> /proc/driver/nvidia/version does not exist 2020-06-28 11:19:48.732628:
> I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports
> instructions that this TensorFlow binary was not compiled to use: AVX2
> FMA 2020-06-28 11:19:48.740029: I
> tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency:
> 2300000000 Hz 2020-06-28 11:19:48.740310: I
> tensorflow/compiler/xla/service/service.cc:168] XLA service 0x16e3640
> initialized for platform Host (this does not guarantee that XLA will
> be used). Devices: 2020-06-28 11:19:48.740347: I
> tensorflow/compiler/xla/service/service.cc:176]   StreamExecutor
> device (0): Host, Default Version INFO:tensorflow:Found and fixed 12
> matches I0628 11:19:49.103435 140522432427904 exporter.py:92] Found
> and fixed 12 matches INFO:tensorflow:Found and fixed 0 matches I0628
> 11:19:49.138400 140522432427904 exporter.py:92] Found and fixed 0
> matches WARNING:tensorflow:From
> /usr/local/lib/python3.6/dist-packages/tensorflow_core/python/tools/freeze_graph.py:127:
> checkpoint_exists (from
> tensorflow.python.training.checkpoint_management) is deprecated and
> will be removed in a future version. Instructions for updating: Use
> standard file APIs to check for files with this prefix. W0628
> 11:19:49.809565 140522432427904 deprecation.py:323] From
> /usr/local/lib/python3.6/dist-packages/tensorflow_core/python/tools/freeze_graph.py:127:
> checkpoint_exists (from
> tensorflow.python.training.checkpoint_management) is deprecated and
> will be removed in a future version. Instructions for updating: Use
> standard file APIs to check for files with this prefix.
> INFO:tensorflow:Restoring parameters from /content/drive/My
> Drive/DeepSpace/models/mnasfpn/train/model.ckpt-100 I0628
> 11:19:50.725562 140522432427904 saver.py:1284] Restoring parameters
> from /content/drive/My
> Drive/DeepSpace/models/mnasfpn/train/model.ckpt-100
> WARNING:tensorflow:From
> /usr/local/lib/python3.6/dist-packages/tensorflow_core/python/tools/freeze_graph.py:233:
> convert_variables_to_constants (from
> tensorflow.python.framework.graph_util_impl) is deprecated and will be
> removed in a future version. Instructions for updating: Use
> `tf.compat.v1.graph_util.convert_variables_to_constants` W0628
> 11:19:52.092961 140522432427904 deprecation.py:323] From
> /usr/local/lib/python3.6/dist-packages/tensorflow_core/python/tools/freeze_graph.py:233:
> convert_variables_to_constants (from
> tensorflow.python.framework.graph_util_impl) is deprecated and will be
> removed in a future version. Instructions for updating: Use
> `tf.compat.v1.graph_util.convert_variables_to_constants`
> WARNING:tensorflow:From
> /usr/local/lib/python3.6/dist-packages/tensorflow_core/python/framework/graph_util_impl.py:277:
> extract_sub_graph (from tensorflow.python.framework.graph_util_impl)
> is deprecated and will be removed in a future version. Instructions
> for updating: Use `tf.compat.v1.graph_util.extract_sub_graph` W0628
> 11:19:52.093257 140522432427904 deprecation.py:323] From
> /usr/local/lib/python3.6/dist-packages/tensorflow_core/python/framework/graph_util_impl.py:277:
> extract_sub_graph (from tensorflow.python.framework.graph_util_impl)
> is deprecated and will be removed in a future version. Instructions
> for updating: Use `tf.compat.v1.graph_util.extract_sub_graph`
> INFO:tensorflow:Froze 658 variables. I0628 11:19:52.769557
> 140522432427904 graph_util_impl.py:334] Froze 658 variables.
> INFO:tensorflow:Converted 658 variables to const ops. I0628
> 11:19:52.859092 140522432427904 graph_util_impl.py:394] Converted 658
> variables to const ops. 2020-06-28 11:19:53.012933: I
> tensorflow/tools/graph_transforms/transform_graph.cc:317] Applying
> strip_unused_nodes
它并没有终止我的跑步,而且这个模型似乎仍然可以工作。但是结果是非常糟糕的。我发现在导入模型时出现了一些问题,但是由于这个错误并没有告诉我到底是什么问题,所以很难弄清楚。 (我删除了错误消息的一些行,因为字符限制不允许更多,但仍然足够,因为整个错误似乎都是一样的)

我正在使用以下配置:
ssd\u mobilenet\u v2\u mnasfpn\u shared\u box\u predictor\u 320x320\u coco\u sync.config
from。我修改了它以适应我的数据集,并更改了标签路径等

# SSD with MnasFPN feature extractor, shared box predictor
# See Chen et al, https://arxiv.org/abs/1912.01106
# Trained on COCO, initialized from scratch.
#
# 0.92B MulAdds, 2.5M Parameters. Latency is 193ms on Pixel 1.
# Achieves 26.6 mAP on COCO14 minival dataset.

# This config is TPU compatible

model {
  ssd {
    inplace_batchnorm_update: true
    freeze_batchnorm: false
    num_classes: 4
    box_coder {
      faster_rcnn_box_coder {
        y_scale: 10.0
        x_scale: 10.0
        height_scale: 5.0
        width_scale: 5.0
      }
    }
    matcher {
      argmax_matcher {
        matched_threshold: 0.5
        unmatched_threshold: 0.5
        ignore_thresholds: false
        negatives_lower_than_unmatched: true
        force_match_for_each_row: true
        use_matmul_gather: true
      }
    }
    similarity_calculator {
      iou_similarity {
      }
    }
    encode_background_as_zeros: true
    anchor_generator {
      multiscale_anchor_generator {
        min_level: 3
        max_level: 6
        anchor_scale: 3.0
        aspect_ratios: [1.0, 2.0, 0.5]
        scales_per_octave: 3
      }
    }
    image_resizer {
      fixed_shape_resizer {
        height: 320
        width: 320
      }
    }
    box_predictor {
      weight_shared_convolutional_box_predictor {
        depth: 64
        class_prediction_bias_init: -4.6
        conv_hyperparams {
          activation: RELU_6,
          regularizer {
            l2_regularizer {
              weight: 0.00004
            }
          }
          initializer {
            random_normal_initializer {
              stddev: 0.01
              mean: 0.0
            }
          }
          batch_norm {
            scale: true,
            decay: 0.997,
            epsilon: 0.001,
          }
        }
        num_layers_before_predictor: 4
        share_prediction_tower: true
        use_depthwise: true
        kernel_size: 3
      }
    }
    feature_extractor {
      type: 'ssd_mobilenet_v2_mnasfpn'
      fpn {
        min_level: 3
        max_level: 6
        additional_layer_depth: 48
      }
      min_depth: 16
      depth_multiplier: 1.0
      conv_hyperparams {
        activation: RELU_6,
        regularizer {
          l2_regularizer {
            weight: 0.00004
          }
        }
        initializer {
          random_normal_initializer {
            stddev: 0.01
            mean: 0.0
          }
        }
        batch_norm {
          scale: true,
          decay: 0.97,
          epsilon: 0.001,
        }
      }
      override_base_feature_extractor_hyperparams: true
    }
    loss {
      classification_loss {
        weighted_sigmoid_focal {
          alpha: 0.25
          gamma: 2.0
        }
      }
      localization_loss {
        weighted_smooth_l1 {
        }
      }
      classification_weight: 1.0
      localization_weight: 1.0
    }
    normalize_loss_by_num_matches: true
    normalize_loc_loss_by_codesize: true
    post_processing {
      batch_non_max_suppression {
        score_threshold: 1e-8
        iou_threshold: 0.6
        max_detections_per_class: 100
        max_total_detections: 100
      }
      score_converter: SIGMOID
    }
  }
}

train_config: {
  batch_size: 1024
  sync_replicas: true
  startup_delay_steps: 0
  replicas_to_aggregate: 32
  num_steps: 100                # TODO edit number steps here (maybe)
  data_augmentation_options {
    random_horizontal_flip {
    }
  }
  data_augmentation_options {
    random_crop_image {
      min_object_covered: 0.0
      min_aspect_ratio: 0.75
      max_aspect_ratio: 3.0
      min_area: 0.75
      max_area: 1.0
      overlap_thresh: 0.0
    }
  }
  optimizer {
    momentum_optimizer: {
      learning_rate: {
        cosine_decay_learning_rate {
          learning_rate_base: 4.
          total_steps: 100          # TODO and here as well
          warmup_learning_rate: .026666
          warmup_steps: 50          # TODO and here asle
        }
      }
      momentum_optimizer_value: 0.9
    }
    use_moving_average: false
  }
  max_number_of_boxes: 100
  unpad_groundtruth_tensors: false
  fine_tune_checkpoint: "{PATH}"
  from_detection_checkpoint: true
}

train_input_reader: {
  tf_record_input_reader {
    input_path: "{PATH}"
  }
  label_map_path: "{PATH}"
}

eval_config: {
  metrics_set: "coco_detection_metrics"
  use_moving_averages: false
  num_examples: 182
}

eval_input_reader: {
  tf_record_input_reader {
    input_path: "{PATH}"
  }
  label_map_path: "{PATH}"
  shuffle: false
  num_readers: 1
}
我主要补充说:

  fine_tune_checkpoint: "{PATH}"
  from_detection_checkpoint: true
我不确定你是不是这样做的,因为它可能随着版本的变化而改变。 但我在没有这些参数的情况下对它进行了测试,仍然得到了相同的错误消息,并且看到训练过程中的损失发生了巨大的变化,因此从检查点加载似乎在这里起作用,似乎不是问题所在

我目前正在tf版本1.15上运行,因为API还不支持2.2。这可能会导致问题,因为mnaspfn头部是全新的(约3个月),可能用于2.2。 但由于它仍然没有任何导入问题,这似乎也不是问题所在


我期待着对这个问题的任何建议。

我也面临着完全相同的问题。任何人都可以在这里帮助解决培训问题??我也面临着完全相同的问题。任何人都可以在此协助解决培训问题??