我正在重新训练 TF 对象检测 API 的 mobilenet(v1)-SSD,并且在训练步骤中遇到错误。
INFO:tensorflow:Starting Session.
INFO:tensorflow:Saving checkpoint to path xxxx/model.ckpt
INFO:tensorflow:Starting Queues.
INFO:tensorflow:Error reported to Coordinator: <class 'tensorflow.python.framework.errors_impl.InvalidArgumentError'>, indices[3] = 3 is not in [0, 3)
[[Node: cond_2/RandomCropImage/PruneCompleteleyOutsideWindow/Gather/Gather_1 = Gather[Tindices=DT_INT64, Tparams=DT_INT64, validate_indices=true, _device="/job:localhost/replica:0/task:0/device:CPU:0"](cond_2/Switch_3:1, cond_2/RandomCropImage/PruneCompleteleyOutsideWindow/Reshape)]]
INFO:tensorflow:global_step/sec: 0
INFO:tensorflow:Caught OutOfRangeError. Stopping Training.
INFO:tensorflow:Finished training! Saving model to disk.
Traceback (most recent call last):
File "object_detection/train.py", line 168, in <module>
tf.app.run()
File "/home/khatta/.virtualenvs/dl/lib/python3.5/site-packages/tensorflow/python/platform/app.py", line 124, in run
_sys.exit(main(argv))
File "object_detection/train.py", line 165, in main
worker_job_name, is_chief, FLAGS.train_dir)
File "xxxx/research/object_detection/trainer.py", line …Run Code Online (Sandbox Code Playgroud) 如何更改配置的优化器
例如以下是 ssd_coco_mobilenetv2 的 confgi
train_config: {
batch_size: 4
optimizer {
rms_prop_optimizer: {
learning_rate: {
exponential_decay_learning_rate {
initial_learning_rate: 0.0001 decay_steps: 800720 decay_factor: 0.95
}
}
momentum_optimizer_value: 0.9
decay: 0.9
epsilon: 1.0
}
}
}
Run Code Online (Sandbox Code Playgroud) 我正在使用 tensorflow 对象检测 api 版本 2 训练最多 10 个检查点的对象检测模型。使用exporter_main_v2.py没有问题的作品导出最终检查点,但是我也想导出例如检查点 3、6 和 8 以比较它们的工作方式在实际设置中。这可能吗?
我试过删除后面的检查点然后运行,exporter_main_v2.py但这会导致错误,指出events.out.tfevents文件中的事件比我尝试导出的事件晚,因此无法继续。
过去 2 个月,我一直在尝试训练对象检测模型,最终按照本教程取得了成功。
这是我的colab,其中包含我所有的工作。
问题是,显示了训练损失,并且平均减少了,但验证损失没有。
在pipeline.config文件中,我确实输入了评估 TFRecord 文件(我假设它是验证数据输入),如下所示:
评估配置{
指标集:“coco_detection_metrics”
use_moving_averages: 假
}
eval_input_reader {
label_map_path: "注释/label_map.pbtxt"
洗牌:假
num_epochs: 1
tf_record_input_reader {
输入路径:“注释/test.record”
}
}
我通读了model_main_tf2.py,它在训练时似乎没有评估,但只在提到 checkpoint_dir 时评估。
因此,我只能监控训练集上的损失,而无法监控验证集上的损失。
因此,我不知道过拟合或欠拟合。
你们中有人成功地使用 model_main_tf2.py 来查看验证损失吗?
此外,很高兴看到经过训练的 mAP 分数。
我知道 keras 培训允许在张量板上看到所有这些东西,但 OD API 似乎要困难得多。
感谢您的时间,如果您仍然对某些事情感到困惑,请告诉我。
python object-detection tensorflow object-detection-api tensorflow2.0
我们已经训练了我们的模型,并使用提供的Python脚本成功地测试了它们。但是,我们现在希望将其部署在我们的网站上并运行网络服务以进行第二轮测试。
是否有一个C ++包装器,以便我们可以像使用Python脚本一样使用它来运行/执行模型?
我有一个工作对象检测模型(经过微调的 MobileNet SSD)可以检测我的自定义小型机器人。我将向它提供一些网络摄像头镜头(将与无人机相关联)并使用实时边界框信息。
所以,我准备买相机。
我的问题:由于 SSD 将输入图像调整为 300x300,因此相机分辨率是否非常重要?更高的分辨率是否意味着更高的准确性(即使它被调整为 300x300)?在运行我的对象检测模型之前,我应该在每一帧将相机素材裁剪成 1:1 的纵横比吗?我应该将图像分成 MxN 裁剪段并一一运行推理吗?
因为我的机器人非常小而且无人机将在 4 米的高度,所以我将有效地尝试检测输入图像上的一个非常小的点。
非常感谢任何形式的智慧,谢谢。
ParseError Traceback(最近一次调用最后一次)
在
----> 1 配置 = config_util.get_configs_from_pipeline_file(CONFIG_PATH)
〜\ AppData \ Roaming \ Python \ Python37 \ site-packages \ object_detection \ utils \ config_util.py get_configs_from_pipeline_file(pipeline_config_path,config_override)
96 with tf.io.gfile.GFile(pipeline_config_path, "r") as f:
97 proto_str = f.read()
Run Code Online (Sandbox Code Playgroud)
---> 98 text_format.Merge(proto_str, pipeline_config)
99 if config_override:
100 text_format.Merge(config_override, pipeline_config)
Run Code Online (Sandbox Code Playgroud)
C:\ProgramData\Anaconda3\lib\site-packages\google\protobuf\text_format.py 合并(文本、消息、allow_unknown_extension、allow_field_number、descriptor_pool、allow_unknown_field)
735 allow_field_number,
736 descriptor_pool=descriptor_pool,
Run Code Online (Sandbox Code Playgroud)
--> 737 允许_未知_字段=允许_未知_字段)
738
739
Run Code Online (Sandbox Code Playgroud)
MergeLines 中的 C:\ProgramData\Anaconda3\lib\site-packages\google\protobuf\text_format.py(行、消息、allow_unknown_extension、allow_field_number、descriptor_pool、allow_unknown_field)
803 descriptor_pool=descriptor_pool,
804 allow_unknown_field=allow_unknown_field)
Run Code Online (Sandbox Code Playgroud)
--> 805 返回 parser.MergeLines(lines, message)
806
807
Run Code Online (Sandbox Code Playgroud)
MergeLines 中的 C:\ProgramData\Anaconda3\lib\site-packages\google\protobuf\text_format.py(self,lines,message)
828 """Merges a text representation of a …Run Code Online (Sandbox Code Playgroud) object-detection tensorflow jupyter-notebook object-detection-api
我正在尝试使用Tensorflow 的对象检测 API 2和 Tensorflow 2.3.0 训练对象检测模型。我主要使用本文作为准备数据和训练模型的资源。
大多数使用对象检测 API 的文章都会在微调之前从Tensorflow 模型库下载预训练的模型。
Tensorflow Model Zoo 是由对象检测团队在 Github 页面上设置的一组链接。当我单击一个此类链接(使用 Google Chrome)时,会短暂打开一个新选项卡,就像正在开始下载一样,然后立即关闭并且不会进行下载。我在文章中找到的其他模型的超链接也不起作用。
对于使用对象检测 API 进行微调的任何人:您使用什么方法下载预训练模型?模型动物园链接有用吗?如果没有,您使用了什么资源?
任何帮助深表感谢。
我目前正在阅读SSD Single Shot Detector,并且有一个我很难理解的术语。该术语是“头”。当我听到这个词时,就像起初一样,我想到了网络的负责人。
我查看了由Google创建的对象检测API,发现带有不同头部类型的“ heads”文件夹,一种用于框编码,另一种用于类预测。
抽象的“ head”类的文档不是超级启发性的:
不同模型中所有不同种类的预测头都将从该类继承。所有头类之间的共同点是它们具有一个 作为其第一个参数
predict接收的features函数。
我想我对它们有较高的了解,但是我对它们没有具体的定义。有人可以定义一个“头”并解释如何拥有“盒子预测头”或“分类头”吗?
machine-learning computer-vision neural-network conv-neural-network object-detection-api
所以我已经在 Tensorflow 工作了一段时间并更改了一些配置等。
我一直在安装和卸载 tensorflow vesions,我一直在这些错误中循环:如果我安装 Tensorflow 2.0,我会收到这个错误
模块“tensorflow”没有属性“GraphDef”
然后,如果我降级到 Tensorflow 1.14,我会收到此错误:
python -c "import tensorflow as tf; print(tf.__version__)"
回溯(最近一次调用):文件“C:\Users\PPE DETECTION\AppData\Roaming\Python\Python35\site-packages\tensorflow\python\pywrap_tensorflow.py”,第 58 行,来自 tensorflow.python.pywrap_tensorflow_internal import * 文件“C:\Users\PPE DETECTION\AppData\Roaming\Python\Python35\site-packages\tensorflow\python\pywrap_tensorflow_internal.py”,第 28 行,在 _pywrap_tensorflow_internal = swig_import_helper() 文件“C:\Users\PPE DETECTION \AppData\Roaming\Python\Python35\site-packages\tensorflow\python\pywrap_tensorflow_internal.py”,第 24 行,在 swig_import_helper _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description) 文件“C:\Users\ PPE DETECTION\Anaconda3\envs\ppe\lib\imp.py”,第 243 行,在 load_module 中 return load_dynamic(name,filename, file) File "C:\Users\PPE DETECTION\Anaconda3\envs\ppe\lib\imp.py", line 343, in load_dynamic return _load(spec) ImportError: DLL load failed: The specified module could not be found .
在处理上述异常的过程中,又发生了一个异常:
回溯(最近一次调用):文件“”,第 1 行,在文件“C:\Users\PPE …
当我尝试训练对象检测模型时,出现以下错误:
Traceback (most recent call last):
File "train.py", line 53, in <module>
from object_detection.builders import model_builder
File "C:\Users\hp\models\research\object_detection\builders\model_builder.py", line 63, in <module>
from object_detection.models import ssd_efficientnet_bifpn_feature_extractor as ssd_efficientnet_bifpn
File "C:\Users\hp\models\research\object_detection\models\ssd_efficientnet_bifpn_feature_extractor.py", line 33, in <module>
from official.vision.image_classification.efficientnet import efficientnet_model
File "C:\Users\hp\models\official\vision\image_classification\efficientnet\efficientnet_model.py", line 35, in <module>
from official.modeling import tf_utils
File "C:\Users\hp\models\official\modeling\tf_utils.py", line 25, in <module>
from official.modeling import activations
File "C:\Users\hp\models\official\modeling\activations\__init__.py", line 16, in <module>
from official.modeling.activations.gelu import gelu
File "C:\Users\hp\models\official\modeling\activations\gelu.py", line 26, in <module>
@tf.keras.utils.register_keras_serializable(package='Text')
AttributeError: module 'tensorflow_core.keras.utils' has no …Run Code Online (Sandbox Code Playgroud) python object-detection keras tensorflow object-detection-api