tensorflow / tensorflow/models
Protocol message object_detection.protos.CenterNet.ObjectDetection has no non-repeated field "scale_head_params"
@pkulzc is already working on this.
Since Aug 11, 2021.
- Dominant language
- Python
- Stars
- 77.7k
- Forks
- 44.8k
- PR merge metrics
- No merged PRs in 30d
Description
Prerequisites
1. The entire URL of the file you are using
google\protobuf\internal\python_message.py", line 868, in HasField
2. Describe the bug
Trying to do a transfer learning using a custom dataset on CenterNet MobileNetV2 FPN 512x512. I have attached full config file. Any idea why it doesn't work?
Console error:
I0810 22:47:21.646980 20652 cross_device_ops.py:619] Reduce to /job:localhost/replica:0/task:0/device:CPU:0 then broadcast to ('/job:localhost/replica:0/task:0/device:CPU:0',).
Traceback (most recent call last):
File "C:\Users\Mihai\AppData\Local\Programs\Python\Python39\lib\site-packages\google\protobuf\internal\python_message.py", line 866, in HasField
field = hassable_fields[field_name]
KeyError: 'scale_head_params'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\Mihai\Desktop\Doctorat\models\workspace\training_demo\model_main_tf2.py", line 113, in
tf.compat.v1.app.run()
File "C:\Users\Mihai\AppData\Local\Programs\Python\Python39\lib\site-packages\tensorflow\python\platform\app.py", line 40, in run
_run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef)
File "C:\Users\Mihai\AppData\Local\Programs\Python\Python39\lib\site-packages\absl\app.py", line 303, in run
_run_main(main, args)
File "C:\Users\Mihai\AppData\Local\Programs\Python\Python39\lib\site-packages\absl\app.py", line 251, in _run_main
sys.exit(main(argv))
File "C:\Users\Mihai\Desktop\Doctorat\models\workspace\training_demo\model_main_tf2.py", line 104, in main
model_lib_v2.train_loop(
File "C:\Users\Mihai\AppData\Local\Programs\Python\Python39\lib\site-packages\object_detection\model_lib_v2.py", line 541, in train_loop
detection_model = MODEL_BUILD_UTIL_MAP['detection_model_fn_base'](
File "C:\Users\Mihai\AppData\Local\Programs\Python\Python39\lib\site-packages\object_detection\builders\model_builder.py", line 1226, in build
return build_func(getattr(model_config, meta_architecture), is_training,
File "C:\Users\Mihai\AppData\Local\Programs\Python\Python39\lib\site-packages\object_detection\builders\model_builder.py", line 1084, in _build_center_net_model
object_detection_params = object_detection_proto_to_params(
File "C:\Users\Mihai\AppData\Local\Programs\Python\Python39\lib\site-packages\object_detection\builders\model_builder.py", line 932, in object_detection_proto_to_params
if od_config.HasField('scale_head_params'):
File "C:\Users\Mihai\AppData\Local\Programs\Python\Python39\lib\site-packages\google\protobuf\internal\python_message.py", line 868, in HasField
raise ValueError(error_msg % (message_descriptor.full_name, field_name))
ValueError: Protocol message object_detection.protos.CenterNet.ObjectDetection has no non-repeated field "scale_head_params"
6. System information
- OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Windows 10
- TensorFlow installed from (source or binary): binary
- TensorFlow version (use command below): 2.5.0
- Python version: 3.9.5
- CUDA/cuDNN version: 10.1
- GPU model and memory: GTX 1070 8GB VRAM
model {
center_net {
num_classes: 2
feature_extractor {
type: "mobilenet_v2_fpn_sep_conv"
}
image_resizer {
keep_aspect_ratio_resizer {
min_dimension: 512
max_dimension: 512
pad_to_max_dimension: true
}
}
use_depthwise: 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
classification_loss {
penalty_reduced_logistic_focal_loss {
alpha: 2.0
beta: 4.0
}
}
min_box_overlap_iou: 0.7
max_box_predictions: 20
}
}
}
train_config {
batch_size: 32
data_augmentation_options {
random_horizontal_flip {
keypoint_flip_permutation: 0
keypoint_flip_permutation: 2
keypoint_flip_permutation: 1
keypoint_flip_permutation: 4
keypoint_flip_permutation: 3
keypoint_flip_permutation: 6
keypoint_flip_permutation: 5
keypoint_flip_permutation: 8
keypoint_flip_permutation: 7
keypoint_flip_permutation: 10
keypoint_flip_permutation: 9
keypoint_flip_permutation: 12
keypoint_flip_permutation: 11
keypoint_flip_permutation: 14
keypoint_flip_permutation: 13
keypoint_flip_permutation: 16
keypoint_flip_permutation: 15
}
}
data_augmentation_options {
random_patch_gaussian {
}
}
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
pad_color: 0.0
pad_color: 0.0
}
}
optimizer {
adam_optimizer {
learning_rate {
cosine_decay_learning_rate {
learning_rate_base: 5e-3
total_steps: 3000
warmup_learning_rate: 1e-4
warmup_steps: 500
}
}
}
use_moving_average: false
}
num_steps: 3000
max_number_of_boxes: 100
unpad_groundtruth_tensors: false
fine_tune_checkpoint_type: "detection"
fine_tune_checkpoint_version: V2
}
train_input_reader {
label_map_path: "annotations/label_map.pbtxt"
tf_record_input_reader {
input_path: "train/coco_train.record-?????-of-00100"
}
filenames_shuffle_buffer_size: 256
num_keypoints: 17
}
eval_config {
num_visualizations: 10
metrics_set: "coco_detection_metrics"
use_moving_averages: false
min_score_threshold: 0.20000000298023224
max_num_boxes_to_visualize: 20
batch_size: 1
}
eval_input_reader {
label_map_path: "annotations/label_map.pbtxt"
shuffle: false
num_epochs: 1
tf_record_input_reader {
input_path: "test/coco_testdev.record-?????-of-00050"
}
num_keypoints: 17
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.