Prerequisites
Please answer the following questions for yourself before submitting an issue.
- [x] I am using the latest TensorFlow Model Garden release and TensorFlow 2.
- [x] I am reporting the issue to the correct repository. (Model Garden official or research directory)
- [x] I checked to make sure that this issue has not already been filed.
1. The entire URL of the file you are using
http://download.tensorflow.org/models/object_detection/tf2/20210210/centernet_mobilenetv2fpn_512x512_coco17_od.tar.gz
2. Describe the bug
Training the CenterNet MobileNetV2 FPN 512x512 network from the model zoo fails with the below error on a custom dataset, both with a custom training script and model_main_tf2,py. The TFRecords are not corrupt as I can train an EfficientDet D0 network with them, both with the custom training script and model_main_tf2.py
3. Steps to reproduce
Try and train the CenterNet MobileNetV2 FPN 512x512 network. I haven't been able to get it to work on my machines so would be interested to know where it does work so troubleshooting might become a bit easier.
4. Expected behaviour
The network should train.
5. Additional context
Traceback from GCP VM with custom training script, but get the same end errors on all the machines tried:
`Function call stack:
_dist_train_step -> _dist_train_step
Traceback (most recent call last):
File "centernet_training_2_1.py", line 1404, in
fold_study = start_study()
File "centernet_training_2_1.py", line 1382, in start_study
study.optimize(objective, n_trials=trials_left)
File "/home/Jon573/miniconda3/envs/odapi/lib/python3.6/site-packages/optuna/study.py", line 385, in optimize
show_progress_bar=show_progress_bar,
File "/home/Jon573/miniconda3/envs/odapi/lib/python3.6/site-packages/optuna/_optimize.py", line 73, in _optimize
progress_bar=progress_bar,
File "/home/Jon573/miniconda3/envs/odapi/lib/python3.6/site-packages/optuna/_optimize.py", line 164, in _optimize_sequential
trial = _run_trial(study, func, catch)
File "/home/Jon573/miniconda3/envs/odapi/lib/python3.6/site-packages/optuna/_optimize.py", line 262, in _run_trial
raise func_err
File "/home/Jon573/miniconda3/envs/odapi/lib/python3.6/site-packages/optuna/_optimize.py", line 211, in _run_trial
value_or_values = func(trial)
File "centernet_training_2_1.py", line 1328, in objective
checkpoint_every_n=steps_in_epoch
File "centernet_training_2_1.py", line 724, in train_loop
loss = _dist_train_step(train_input_iter)
File "/home/Jon573/miniconda3/envs/odapi/lib/python3.6/site-packages/tensorflow/python/eager/def_function.py", line 828, in call
result = self._call(*args, **kwds)
File "/home/Jon573/miniconda3/envs/odapi/lib/python3.6/site-packages/tensorflow/python/eager/def_function.py", line 888, in _call
return self._stateless_fn(*args, **kwds)
File "/home/Jon573/miniconda3/envs/odapi/lib/python3.6/site-packages/tensorflow/python/eager/function.py", line 2943, in call
filtered_flat_args, captured_inputs=graph_function.captured_inputs) # pylint: disable=protected-access
File "/home/Jon573/miniconda3/envs/odapi/lib/python3.6/site-packages/tensorflow/python/eager/function.py", line 1919, in _call_flat
ctx, args, cancellation_manager=cancellation_manager))
File "/home/Jon573/miniconda3/envs/odapi/lib/python3.6/site-packages/tensorflow/python/eager/function.py", line 560, in call
ctx=ctx)
File "/home/Jon573/miniconda3/envs/odapi/lib/python3.6/site-packages/tensorflow/python/eager/execute.py", line 60, in quick_execute
inputs, attrs, num_outputs)
tensorflow.python.framework.errors_impl.InvalidArgumentError: 2 root error(s) found.
(0) Invalid argument: indices[0] = 0 is not in [0, 0)
[[{{node GatherV2_8}}]]
[[MultiDeviceIteratorGetNextFromShard]]
[[RemoteCall]]
[[IteratorGetNext]]
(1) Invalid argument: indices[0] = 0 is not in [0, 0)
[[{{node GatherV2_8}}]]
[[MultiDeviceIteratorGetNextFromShard]]
[[RemoteCall]]
[[IteratorGetNext]]
[[Loss/total_loss/write_summary/summary_cond/branch_executed/_57/_195]]
0 successful operations.
0 derived errors ignored. [Op:__inference__dist_train_step_23949]
Function call stack:
_dist_train_step -> _dist_train_step`
6. System information
3 machines tried on:
- Ubuntu 20.04.2 LTS, RTX2080ti, 32GB of RAM, CUDA/cuDNN version: 11.0/8.0.4
- VM on GCP, Ubuntu 20.04.2 LTS, Nvidia T4, 26GB RAM, CUDA/cuDNN version: 11.0/8.0.4
- Windos 10 (Build 19042.844), GTX1050ti, 16GB RAM, CUDA/cuDNN version: 11.0/8.1.0
Common to all 3:
- TensorFlow installed from (source or binary): binary
- TensorFlow version (use command below): 2.4.1
- Python version: 3.6.12
Having the same issue.
I'm working with the docker image with some minor tweaks since the last object detection dockerfile has tensorflow 2.2 but this code is for Tensorflow 2.4
- Ubuntu 20.04.2 LTS, RTX 2070 Super, CUDA 11.2
Anyone successfully found a solution?
I had the same issue. So I removed keypoint parameters, like as num_keypoints and keypoint_flip_permutation, from pipeline.config, it was working.
Sorry, it has been a while and I only just got back around to this. @mah110mat your solution worked, thank you!!
Are you satisfied with the resolution of your issue?
Yes
No