Open danielspicar opened 3 years ago
Hello everybody! I had this problem fixed when I changed Tensorflow_GPU to version 2.4.1. Tensorflow_GPU version 2.2 was when I started this.
python -m pip uninstall tensorflow-gpu==2.2 python -m pip uninstall tensorflow==2.4.1
python -m pip install tensorflow-gpu==2.4.1 python -m pip install numpy==1.17.1
Hi, @danielspicar,,
I too faced this problem and @muhiddinov is correct with his solution.
I will add a bit more to explain what is happening behind the scenes.
TF has changed map_fn_v2() implementation in going from TF 2.2 to TF2.3. Posting below function definition from both files.
TF2.2 version https://github.com/tensorflow/tensorflow/blob/r2.2/tensorflow/python/ops/map_fn.py
def map_fn_v2(fn, elems, dtype=None, parallel_iterations=None, back_prop=True, swap_memory=False, infer_shape=True, name=None):
TF2.3 version https://github.com/tensorflow/tensorflow/blob/r2.3/tensorflow/python/ops/map_fn.py
def map_fn_v2(fn, elems, dtype=None, parallel_iterations=None, back_prop=True, swap_memory=False, infer_shape=True, name=None, fn_output_signature=None):
You can see added parameter in function definition in TF2.3 version, and it is also true for higher versions.
Thus, upgrading your TF to 2.3 or higher versions will remove this issue. However, do check this link - https://www.tensorflow.org/install/source#tested_build_configurations
Specifically, this part:-
Upgrading to TF2.4 will involve changing CUDA version too, which is frankly an additional hassle. Therefore, I would recommend upgrading to a suitable version of TF to avoid changing everything in your system.
Hopefully, I have solved the problem.
Thanks all.
Warmly, Ankit Rathore.
Thank you. I worked around the issue by building a custom Docker container with TF 2.2 but the source code from before commit 0d6ce6025ffc2bed437160fc8b2e9934b3f82fad
I will try TF 2.3 soon as upgrading CUDA for TF 2.4 is not possible for me. I do not have such priviledges on the GPU server I use (and I don't want to waste the admin's goodwill just for a test ;) ).
Anyway, it seems that the Dockerfile should be updated to use at least tf-gpu 2.3.1.
I will report back when I get to check if it works with tf 2.3. But perhaps somebody else can verify this.
@danielspicar Ran into this issue in my environment as well. Upgrading TF to 2.3.1 worked ! It still throws a warning but export completes successfully.
how about tensorflow:2.2.2 ? I only have mac's cpu,and i meet the same problem. Is there somebody could share something? thx
Namaste,
I am using TF 2.2. Just replace the argument in exporter_main_v2.py . Instead of fn_output_signature=(tf.float32, tf.int32) use dtype=(tf.float32, tf.int32)
It worked for me.
Prerequisites
Please answer the following questions for yourself before submitting an issue.
1. The entire URL of the file you are using
https://github.com/tensorflow/models/tree/master/research/object_detection
https://github.com/tensorflow/models/blob/master/research/object_detection/exporter_lib_v2.py
2. Describe the bug
I am trying to export an EfficientDet D0 model trained with TF2 OD API from a trained checkpoint to SavedModel format.
I trained the model from the model zoo pretrained model on a custom dataset.
The export fails with the error:
3. Steps to reproduce
python ./object_detection/model_main_tf2.py --pipeline_config_path=/path/to/pipeline.config --model_dir=/path/to/checkpoints/ --alsologtostderr
python ./object_detection/exporter_main_v2.py --input_type image_tensor --pipeline_config_path /path/to/pipeline.config --trained_checkpoint_dir /path/to/checkpoints/ --output_directory /path/to/export/dir
4. Expected behavior
The export should not fail.
5. Additional context
I noticed that the location of the error was last modified by commit 0d6ce6025ffc2bed437160fc8b2e9934b3f82fad which appears to have added a new function that causes this error.
Full log:
pipeline.config
6. System information