- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在尝试训练模型来检查图像、识别指定对象并告诉我它的坐标(我什至不需要看到对象周围的正方形)。
为此,我使用了 Tensorflow 的对象检测,我所做的大部分工作都是在查看本教程:
但是有些事情发生了变化,可能是因为更新,然后我不得不自己做一些事情。我实际上可以训练模型(我猜)但我不了解评估结果。我曾经看到过损失和当前步骤,但这个输出对我来说很不寻常。我也不认为培训会被保存下来。
model_main.py --logtostderr --train_dir=training/ --pipeline_config_path=training/faster_rcnn_inception_v2_coco.config
model {
faster_rcnn {
num_classes: 9
image_resizer {
keep_aspect_ratio_resizer {
min_dimension: 600
max_dimension: 1024
}
}
feature_extractor {
type: 'faster_rcnn_inception_v2'
first_stage_features_stride: 16
}
first_stage_anchor_generator {
grid_anchor_generator {
scales: [0.25, 0.5, 1.0, 2.0]
aspect_ratios: [0.5, 1.0, 2.0]
height_stride: 16
width_stride: 16
}
}
first_stage_box_predictor_conv_hyperparams {
op: CONV
regularizer {
l2_regularizer {
weight: 0.0
}
}
initializer {
truncated_normal_initializer {
stddev: 0.01
}
}
}
first_stage_nms_score_threshold: 0.0
first_stage_nms_iou_threshold: 0.7
first_stage_max_proposals: 300
first_stage_localization_loss_weight: 2.0
first_stage_objectness_loss_weight: 1.0
initial_crop_size: 14
maxpool_kernel_size: 2
maxpool_stride: 2
second_stage_box_predictor {
mask_rcnn_box_predictor {
use_dropout: false
dropout_keep_probability: 1.0
fc_hyperparams {
op: FC
regularizer {
l2_regularizer {
weight: 0.0
}
}
initializer {
variance_scaling_initializer {
factor: 1.0
uniform: true
mode: FAN_AVG
}
}
}
}
}
second_stage_post_processing {
batch_non_max_suppression {
score_threshold: 0.0
iou_threshold: 0.6
max_detections_per_class: 100
max_total_detections: 300
}
score_converter: SOFTMAX
}
second_stage_localization_loss_weight: 2.0
second_stage_classification_loss_weight: 1.0
}
}
train_config: {
batch_size: 5
optimizer {
momentum_optimizer: {
learning_rate: {
manual_step_learning_rate {
initial_learning_rate: 0.0002
schedule {
step: 900000
learning_rate: .00002
}
schedule {
step: 1200000
learning_rate: .000002
}
}
}
momentum_optimizer_value: 0.9
}
use_moving_average: false
}
gradient_clipping_by_norm: 10.0
fine_tune_checkpoint: "faster_rcnn_inception_v2_coco_2018_01_28/model.ckpt"
from_detection_checkpoint: true
num_steps: 50000
data_augmentation_options {
random_horizontal_flip {
}
}
}
train_input_reader: {
tf_record_input_reader {
input_path: "C:/tensorflow1/models/research/object_detection/images/train.record"
}
label_map_path: "C:/tensorflow1/models/research/object_detection/training/object-detection.pbtxt"
}
eval_config: {
num_examples: 67
max_evals: 10
}
eval_input_reader: {
tf_record_input_reader {
input_path: "C:/tensorflow1/models/research/object_detection/images/test.record"
}
label_map_path: "C:/tensorflow1/models/research/object_detection/training/object-detection.pbtxt"
shuffle: false
num_readers: 1
}
2019-03-16 01:05:23.842424: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1512] Adding visible gpu devices: 0
2019-03-16 01:05:23.842528: I tensorflow/core/common_runtime/gpu/gpu_device.cc:984] Device interconnect StreamExecutor with strength 1 edge matrix:
2019-03-16 01:05:23.845561: I tensorflow/core/common_runtime/gpu/gpu_device.cc:990] 0
2019-03-16 01:05:23.845777: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1003] 0: N
2019-03-16 01:05:23.847854: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1115] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 6390 MB memory) -> physical GPU (device: 0, name: GeForce GTX 1070, pci bus id: 0000:01:00.0, compute capability: 6.1)
creating index...
index created!
creating index...
index created!
Running per image evaluation...
Evaluate annotation type *bbox*
DONE (t=0.05s).
Accumulating evaluation results...
DONE (t=0.04s).
Average Precision (AP) @[ IoU=0.50:0.95 | area= all | maxDets=100 ] = 0.681
Average Precision (AP) @[ IoU=0.50 | area= all | maxDets=100 ] = 1.000
Average Precision (AP) @[ IoU=0.75 | area= all | maxDets=100 ] = 0.670
Average Precision (AP) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.542
Average Precision (AP) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.825
Average Precision (AP) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = -1.000
Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets= 1 ] = 0.682
Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets= 10 ] = 0.689
Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets=100 ] = 0.689
Average Recall (AR) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.556
Average Recall (AR) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.825
Average Recall (AR) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = -1.000
另外 faster_rcnn_inception_v2_coco_2018_01_28
中的模型自 2018 年 1 月以来没有更改,这可能意味着即使它正在训练,也不会保存进度。
我的问题是:
最佳答案
哇,这里有很多问题要回答。
1 .我认为你的配置文件是正确的,通常需要仔细配置的字段是:
num_classes:
数据集的类数fine_tune_checkpoint
:如果您采用转移学习,则开始训练的检查点,如果 from_detection_checkpoint
设置为 true,则应提供此检查点。label_map_path
:标签文件路径,类数应等于num_classes
input_path
train_input_reader
和 eval_input_reader
num_examples
在 eval_config
中,这是您的验证数据集大小,例如验证数据集中的示例数量。num_steps
:这是在模型停止训练之前要达到的训练步数总数。 2 是的,你的训练过程正在被保存,它保存在train_dir
(如果你使用旧版本的api,但是如果你使用最新的model_dir
版),官方描述为here .您可以使用 tensorbard
可视化您的训练过程。
3 COCO 评估格式的输出,因为这是默认的评估指标选项。但是您可以通过在配置文件的 eval_config
中设置 metrics_set :
来尝试其他评估指标,其他选项可用 here .对于 coco 指标,具体来说:
IoU
是Intersection over Union,它定义了检测边界框与真实边界框的重叠程度。 This答案提供了更多详细信息,让您了解如何根据不同的 IoU 计算精度。maxDets
是 thresholds on max detections per image (参见 here 以获得更好的讨论)area
,区域分为三类,根据区域所占的像素数,small, medium, large 都有定义here . 4 一旦总训练步数达到 cofig 文件中设置的 num_steps
,训练将停止。在您的案例中,每 15 分钟执行一次评估 session 。此外,还可以在配置 file 中配置每次评估执行的频率。 .
5 虽然你按照上面的教程,但我建议按照官方API文档https://github.com/tensorflow/models/tree/master/research/object_detection .
PS:确实我可以确认负精度分数是因为没有相应的类别。请参阅 cocoapi 中的引用资料.
关于python - Tensorflow 对象检测后续步骤,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55193486/
我的一位教授给了我们一些考试练习题,其中一个问题类似于下面(伪代码): a.setColor(blue); b.setColor(red); a = b; b.setColor(purple); b
我似乎经常使用这个测试 if( object && object !== "null" && object !== "undefined" ){ doSomething(); } 在对象上,我
C# Object/object 是值类型还是引用类型? 我检查过它们可以保留引用,但是这个引用不能用于更改对象。 using System; class MyClass { public s
我在通过 AJAX 发送 json 时遇到问题。 var data = [{"name": "Will", "surname": "Smith", "age": "40"},{"name": "Wil
当我尝试访问我的 View 中的对象 {{result}} 时(我从 Express js 服务器发送该对象),它只显示 [object][object]有谁知道如何获取 JSON 格式的值吗? 这是
我有不同类型的数据(可能是字符串、整数......)。这是一个简单的例子: public static void main(String[] args) { before("one"); }
嗨,我是 json 和 javascript 的新手。 我在这个网站找到了使用json数据作为表格的方法。 我很好奇为什么当我尝试使用 json 数据作为表时,我得到 [Object,Object]
已关闭。此问题需要 debugging details 。目前不接受答案。 编辑问题以包含 desired behavior, a specific problem or error, and the
我听别人说 null == object 比 object == null check 例如: void m1(Object obj ) { if(null == obj) // Is thi
Match 对象 提供了对正则表达式匹配的只读属性的访问。 说明 Match 对象只能通过 RegExp 对象的 Execute 方法来创建,该方法实际上返回了 Match 对象的集合。所有的
Class 对象 使用 Class 语句创建的对象。提供了对类的各种事件的访问。 说明 不允许显式地将一个变量声明为 Class 类型。在 VBScript 的上下文中,“类对象”一词指的是用
Folder 对象 提供对文件夹所有属性的访问。 说明 以下代码举例说明如何获得 Folder 对象并查看它的属性: Function ShowDateCreated(f
File 对象 提供对文件的所有属性的访问。 说明 以下代码举例说明如何获得一个 File 对象并查看它的属性: Function ShowDateCreated(fil
Drive 对象 提供对磁盘驱动器或网络共享的属性的访问。 说明 以下代码举例说明如何使用 Drive 对象访问驱动器的属性: Function ShowFreeSpac
FileSystemObject 对象 提供对计算机文件系统的访问。 说明 以下代码举例说明如何使用 FileSystemObject 对象返回一个 TextStream 对象,此对象可以被读
我是 javascript OOP 的新手,我认为这是一个相对基本的问题,但我无法通过搜索网络找到任何帮助。我是否遗漏了什么,或者我只是以错误的方式解决了这个问题? 这是我的示例代码: functio
我可以很容易地创造出很多不同的对象。例如像这样: var myObject = { myFunction: function () { return ""; } };
function Person(fname, lname) { this.fname = fname, this.lname = lname, this.getName = function()
任何人都可以向我解释为什么下面的代码给出 (object, Object) 吗? (console.log(dope) 给出了它应该的内容,但在 JSON.stringify 和 JSON.parse
我正在尝试完成散点图 exercise来自免费代码营。然而,我现在只自己学习了 d3 几个小时,在遵循 lynda.com 的教程后,我一直在尝试确定如何在工具提示中显示特定数据。 This code
我是一名优秀的程序员,十分优秀!