tensorflow / tensorflow/models
Object Detection API ValueError: The function random_horizontal_flip does not exist in func_arg_map
@pkulzc is already working on this.
Since Nov 15, 2021.
- Dominant language
- Python
- Stars
- 77.7k
- Forks
- 44.8k
- PR merge metrics
- No merged PRs in 30d
Description
I'm encountering an issue when I try using the object detection API. Specifically, the error occurs here
https://github.com/tensorflow/models/blob/master/research/object_detection/core/preprocessor.py
I am using TensorFlow 2.6.0 and I noticed that this issue was also reported here https://github.com/tensorflow/models/issues/4108 but there wasn't really any response or solution to the issue.
Here is a description of the bug I'm getting.
Traceback (most recent call last):
File "C:/TensorFlow/Tensorflow_Object_Detection/models_v2/app_execute.py", line 45, in
main()
File "C:/TensorFlow/Tensorflow_Object_Detection/models_v2/app_execute.py", line 10, in main
menu()
File "C:/TensorFlow/Tensorflow_Object_Detection/models_v2/app_execute.py", line 34, in menu
train.main(None)
File "C:\TensorFlow\Tensorflow_Object_Detection\models_v2\app_train.py", line 192, in main
graph_hook_fn=graph_rewriter_fn)
File "C:\TensorFlow\Tensorflow_Object_Detection\models_v2\research\object_detection\trainer.py", line 273, in train
train_config.prefetch_queue_capacity, data_augmentation_options)
File "C:\TensorFlow\Tensorflow_Object_Detection\models_v2\research\object_detection\trainer.py", line 79, in create_input_queue
include_keypoints=include_keypoints))
File "C:\TensorFlow\Tensorflow_Object_Detection\models_v2\research\object_detection\core\preprocessor.py", line 4731, in preprocess
(func.name))
ValueError: The function random_horizontal_flip does not exist in func_arg_map
Basically, I am trying to train a model using code similar to the one here (i.e. app_train.py is basically the train.py in the link below, but slightly customized)
https://github.com/tensorflow/models/blob/master/research/object_detection/legacy/train.py
It results in me getting this error.
I believe the expected behaviour is for the training process to work, since the error seems to exist purely within the preprocessor.py file.
Some additional context: originally, I had these scripts which would train an object detection model, and it would work in Tensorflow 1.14.0. I'm trying to migrate it to Tensorflow 2.6.0. What I've done is run the TF2 migration script across my code, and downloaded the official folders from here
https://github.com/tensorflow/models/tree/master/research/object_detection
The train part of my script is based on the legacy/train.py file as described above.
This worked for tensorflow 1.14, and I never encountered this issue. However, I am encountering it now during my migration process.
Some basic system information:
- OS Platform: Windows
- TensorFlow version (use command below): 2.6.0
- Python version: 3.6
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.