为什么我只使用预训练的苗条模型才能获得双重信息字符串?

时间:2018-01-05 16:18:31

标签: tensorflow object-detection

我开始使用inception_v2_imagenet_2016_08_28预训练模型训练一个faster_rcnn_inception_v2。

  fine_tune_checkpoint: "./pretrained_models/inception_v2_imagenet_2016_08_28/inception_v2.ckpt"
  from_detection_checkpoint: false

我收到有关缺少参数(gamma)的警告。 比我把所有信息加倍。

INFO:tensorflow:global step 435766: loss = 0.7736 (0.27 sec/step)  
INFO:tensorflow:global step 435766: loss = 0.7736 (0.27 sec/step)

为什么呢?有解决方案吗? 感谢。

1 个答案:

答案 0 :(得分:0)

我找到了解决这个问题的方法!

该错误位于https://github.com/tensorflow/models/blob/master/research/object_detection/utils/variables_helper.py中的def get_variables_available_in_checkpoint(variables, checkpoint_path): """Returns the subset of variables available in the checkpoint. Inspects given checkpoint and returns the subset of variables that are available in it. TODO: force input and output to be a dictionary. Args: variables: a list or dictionary of variables to find in checkpoint. checkpoint_path: path to the checkpoint to restore variables from. Returns: A list or dictionary of variables. Raises: ValueError: if `variables` is not a list or dict. """ if isinstance(variables, list): variable_names_map = {variable.op.name: variable for variable in variables} elif isinstance(variables, dict): variable_names_map = variables else: raise ValueError('`variables` is expected to be a list or dict.') ckpt_reader = tf.train.NewCheckpointReader(checkpoint_path) ckpt_vars = ckpt_reader.get_variable_to_shape_map().keys() vars_in_ckpt = {} for variable_name, variable in sorted(variable_names_map.items()): if variable_name in ckpt_vars: vars_in_ckpt[variable_name] = variable else: logging.warning('Variable [%s] not available in checkpoint', variable_name) if isinstance(variables, list): return vars_in_ckpt.values() return vars_in_ckpt 函数中:

    # else:
    #     logging.warning('Variable [%s] not available in checkpoint',
    #                     variable_name)

我对此部分进行了评论,培训期间的信息仅显示一次。

var params = {
    CollectionId: collectionId,
    Image: {
        Bytes: new Buffer(imageBytes, 'base64')
    }
};