models icon indicating copy to clipboard operation
models copied to clipboard

RuntimeError: tf.placeholder() is not compatible with eager execution .

Open Priyabrata409 opened this issue 3 years ago • 2 comments

Prerequisites

I am using Tensorflow 2.5 in python 3.8. I am trying to get the frozen_grpah.pb file by running following command !python Tensorflow\models\research\object_detection\export_inference_graph.py --input_type=image_tensor --pipeline_config_path=Tensorflow\workspace\models\my_ssd_mobnet\pipeline.config --trained_checkpoint_prefix=Tensorflow\workspace\models\my_ssd_mobnet\ckpt-11.data-00000-of-00001 --output_directory=Tensorflow\workspace\models\my_ssd_mobnet\export

I got the following issue Traceback (most recent call last): File "Tensorflow\models\research\object_detection\export_inference_graph.py", line 206, in tf.app.run() File "C:\Users\priyabrata\AppData\Roaming\Python\Python38\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\priyabrata\anaconda3\envs\tensorflow_gpu\lib\site-packages\absl\app.py", line 303, in run _run_main(main, args) File "C:\Users\priyabrata\anaconda3\envs\tensorflow_gpu\lib\site-packages\absl\app.py", line 251, in _run_main sys.exit(main(argv)) File "Tensorflow\models\research\object_detection\export_inference_graph.py", line 194, in main exporter.export_inference_graph( File "C:\Users\priyabrata\anaconda3\envs\tensorflow_gpu\lib\site-packages\object_detection-0.1-py3.8.egg\object_detection\exporter.py", line 611, in export_inference_graph _export_inference_graph( File "C:\Users\priyabrata\anaconda3\envs\tensorflow_gpu\lib\site-packages\object_detection-0.1-py3.8.egg\object_detection\exporter.py", line 503, in _export_inference_graph outputs, placeholder_tensor_dict = build_detection_graph( File "C:\Users\priyabrata\anaconda3\envs\tensorflow_gpu\lib\site-packages\object_detection-0.1-py3.8.egg\object_detection\exporter.py", line 457, in build_detection_graph placeholder_tensor, input_tensors = input_placeholder_fn_map[input_type]( File "C:\Users\priyabrata\anaconda3\envs\tensorflow_gpu\lib\site-packages\object_detection-0.1-py3.8.egg\object_detection\exporter.py", line 186, in _image_tensor_input_placeholder input_tensor = tf.placeholder( File "C:\Users\priyabrata\AppData\Roaming\Python\Python38\site-packages\tensorflow\python\ops\array_ops.py", line 3268, in placeholder raise RuntimeError("tf.placeholder() is not compatible with " RuntimeError: tf.placeholder() is not compatible with eager execution.

I also checked the exporter.py ,but couldn't fix the issue

Priyabrata409 avatar May 31 '21 07:05 Priyabrata409