我有预先培训过的模型centernet_32 104_512x512_kpt_ and 17_tpu-32,创建了.record文件并使用键点数据集进行了注释。当我运行命令时:
python model_main_tf2.py --alsologtostderr --pipeline_config_path=pipelines/keypoints/centernet_hg104_512x512_kpts_coco17_tpu-32.config --model_dir=workspace/training_dir/centernet_hg104_512x512_kpts_coco17_tpu-32/出现了以下错误:
TypeError: in user code:
File "venv/lib/python3.8/site-packages/object_detection/inputs.py", line 887, in transform_and_pad_input_data_fn *
tensor_dict = pad_input_data_to_static_shapes(
File "venv/lib/python3.8/site-packages/object_detection/inputs.py", line 319, in transform_input_data *
out_tensor_dict[flds_gt_kpt_weights] = (
File "venv/lib/python3.8/site-packages/object_detection/core/keypoint_ops.py", line 349, in keypoint_weights_from_visibilities *
per_keypoint_weight_mult = tf.ones((1, num_keypoints,), dtype=tf.float32)
TypeError: Expected int32, but got None of type 'NoneType在pipeline.config中,我有指向标签映射文件和.record文件的路径。
我训练过盒子模型,没有任何问题,但是有了关键点注释,我没有找到正确的解决方案。
发布于 2022-05-15 21:17:59
我创建了一个详细的github回购自定义关键点检测,用于基于Tensorflow对象检测API的数据集准备、模型训练和基于关键点检测模型的推理,并给出了实例。
关键点检测模型的数据集准备与对象检测完全不同。不幸的是,没有来自Tensorflow的官方文件。因此,我制定了数据集准备、流水线配置和模型培训的步骤。此回购可以帮助您在自定义数据集上培训您的keypoint检测模型。
与该项目有关的任何问题都可以在github本身提出,在此可以消除疑虑。
https://stackoverflow.com/questions/70697196
复制相似问题