首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法在Colab训练tensorflow 2模型

无法在Colab训练tensorflow 2模型
EN

Stack Overflow用户
提问于 2021-03-08 13:59:07
回答 1查看 145关注 0票数 0

我有这个问题,我在google中使用tensorflow 2,我相信这个错误与配置文件中的路径有关。我使用了"./“和"//”,我也给出了完整的路径,但是我无法消除这个错误。

tensorflow.python.framework.errors_impl.NotFoundError:不成功的TensorSliceReader构造函数:未能找到任何匹配的/content/models/research/object_detection/centernet_resnet50_v1_fpn_512x512_coco17_tpu-8/model.ckpt文件

我修改了配置文件

代码语言:javascript
复制
# CenterNet meta-architecture from the "Objects as Points" [1] paper
# with the ResNet-v2-101 backbone. The ResNet backbone has a few differences
# as compared to the one mentioned in the paper, hence the performance is
# slightly worse. This config is TPU comptatible.
# [1]: https://arxiv.org/abs/1904.07850
#

model {
  center_net {
    num_classes: 2
    feature_extractor {
      type: "resnet_v1_50_fpn"
    }
    image_resizer {
      keep_aspect_ratio_resizer {
        min_dimension: 512
        max_dimension: 512
        pad_to_max_dimension: true
      }
    }
    object_detection_task {
      task_loss_weight: 1.0
      offset_loss_weight: 1.0
      scale_loss_weight: 0.1
      localization_loss {
        l1_localization_loss {
        }
      }
    }
    object_center_params {
      object_center_loss_weight: 1.0
      min_box_overlap_iou: 0.7
      max_box_predictions: 100
      classification_loss {
        penalty_reduced_logistic_focal_loss {
          alpha: 2.0
          beta: 4.0
        }
      }
    }
  }
}
train_config: {

  batch_size: 128
  num_steps: 250000

  data_augmentation_options {
    random_horizontal_flip {
    }
  }

  data_augmentation_options {
    random_crop_image {
      min_aspect_ratio: 0.5
      max_aspect_ratio: 1.7
      random_coef: 0.25
    }
  }


  data_augmentation_options {
    random_adjust_hue {
    }
  }

  data_augmentation_options {
    random_adjust_contrast {
    }
  }

  data_augmentation_options {
    random_adjust_saturation {
    }
  }

  data_augmentation_options {
    random_adjust_brightness {
    }
  }

  data_augmentation_options {
    random_absolute_pad_image {
       max_height_padding: 200
       max_width_padding: 200
       pad_color: [0, 0, 0]
    }
  }

  optimizer {
    adam_optimizer: {
      epsilon: 1e-7  # Match tf.keras.optimizers.Adam's default.
      learning_rate: {
        cosine_decay_learning_rate {
          learning_rate_base: 1e-3
          total_steps: 250000
          warmup_learning_rate: 2.5e-4
          warmup_steps: 5000
        }
      }
    }
    use_moving_average: false
  }
  max_number_of_boxes: 100
  unpad_groundtruth_tensors: false

  fine_tune_checkpoint_version: V2
  fine_tune_checkpoint: "/content/models/research/object_detection/centernet_resnet50_v1_fpn_512x512_coco17_tpu-8/model.ckpt"
  fine_tune_checkpoint_type: "classification"
}

train_input_reader: {
  label_map_path: "/content/models/research/object_detection/training/labelmap.pbtxt"
  tf_record_input_reader {
    input_path: "/content/models/research/object_detection/train.record"
  }
}

eval_config: {
  metrics_set: "coco_detection_metrics"
  use_moving_averages: false
  batch_size: 1;
}

eval_input_reader: {
  label_map_path: "/content/models/research/object_detection/training/labelmap.pbtxt"
  shuffle: false
  num_epochs: 1
  tf_record_input_reader {
    input_path:  "/content/models/research/object_detection/test.record"
  }
}
EN

回答 1

Stack Overflow用户

发布于 2021-03-10 07:23:15

问题是与模型,我已经使用了一个不同的模型与它的配置管道文件和它的工作。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/66531198

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档