# tensorflow.python.framework.errors\_impl.InvalidArgumentError: Graph execution error:

**URL:** <https://discuss.ai.google.dev/t/tensorflow-python-framework-errors-impl-invalidargumenterror-graph-execution-error/31178>\
**Category:** TensorFlow\
**Tags:** object-detection, models\
**Created:** [September 11, 2023, 3:10am UTC](https://discuss.ai.google.dev/t/tensorflow-python-framework-errors-impl-invalidargumenterror-graph-execution-error/31178 "2023-09-11T03:10:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![X\_Life](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/x_life/32/9599_2.png) [@X\_Life](https://discuss.ai.google.dev/u/X_Life)\
**Post date:** [September 11, 2023, 3:10am UTC](https://discuss.ai.google.dev/t/tensorflow-python-framework-errors-impl-invalidargumenterror-graph-execution-error/31178/1 "2023-09-11T03:10:45Z")

</div>

I am training an object detection model. I’m using the already pretrained center net model config. Everything has been configured to the paths of my training and testing data(in the tfrecord format). But when I run the script I get the following error

C:\Users\SHOCKER\anaconda\envs\tf\_gpu\lib\site-packages\keras\src\backend.py:452: UserWarning: `tf.keras.backend.set_learning_phase` is deprecated and will be removed after 2020-10-11. To update it, simply pass a True/False value to the `training` argument of the ` __call__ ` method of your layer or model.  
warnings.warn(  
Traceback (most recent call last):  
File “C:\Users\SHOCKER\tensorflow\_projects\models-master\research\object\_detection\model\_main\_tf2.py”, line 114, in   
tf.compat.v1.app.run()  
File “C:\Users\SHOCKER\anaconda\envs\tf\_gpu\lib\site-packages\tensorflow\python\platform\app.py”, line 36, in run  
\_run(main=main, argv=argv, flags\_parser=\_parse\_flags\_tolerate\_undef)  
File “C:\Users\SHOCKER\anaconda\envs\tf\_gpu\lib\site-packages\absl\app.py”, line 308, in run  
\_run\_main(main, args)  
File “C:\Users\SHOCKER\anaconda\envs\tf\_gpu\lib\site-packages\absl\app.py”, line 254, in \_run\_main  
sys.exit(main(argv))  
File “C:\Users\SHOCKER\tensorflow\_projects\models-master\research\object\_detection\model\_main\_tf2.py”, line 105, in main  
model\_lib\_v2.train\_loop(  
File “C:\Users\SHOCKER\AppData\Roaming\Python\Python39\site-packages\object\_detection\model\_lib\_v2.py”, line 685, in train\_loop  
losses\_dict = \_dist\_train\_step(train\_input\_iter)  
File “C:\Users\SHOCKER\anaconda\envs\tf\_gpu\lib\site-packages\tensorflow\python\util\traceback\_utils.py”, line 153, in error\_handler  
raise e.with\_traceback(filtered\_tb) from None  
File “C:\Users\SHOCKER\anaconda\envs\tf\_gpu\lib\site-packages\tensorflow\python\eager\execute.py”, line 53, in quick\_execute  
tensors = pywrap\_tfe.TFE\_Py\_Execute(ctx.\_handle, device\_name, op\_name,  
tensorflow.python.framework.errors\_impl.InvalidArgumentError: Graph execution error:

indices[0] = 0 is not in [0, 0)  
[[{{node GatherV2\_8}}]]  
[[MultiDeviceIteratorGetNextFromShard]]  
[[RemoteCall]]  
[[while/body/\_1/IteratorGetNext]] [Op:\_\_inference\_\_dist\_train\_step\_35314]

I’m not sure why this is happening, could I please get some help

---

<div class="post-metadata">

**Author:** ![Renu\_Patel](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/renu_patel/32/8957_2.png) [@Renu\_Patel](https://discuss.ai.google.dev/u/Renu_Patel)\
**Post date:** [October 11, 2023, 3:18pm UTC](https://discuss.ai.google.dev/t/tensorflow-python-framework-errors-impl-invalidargumenterror-graph-execution-error/31178/3 "2023-10-11T15:18:28Z")

</div>

Hi @X_Life

Welcome to the TensorFlow Forum!

The reason behind this error could be that model has used older deprecated apis which are not supported with the latest Tensorflow version and throwing the error. As mentioned in error log " `tf.keras.backend.set_learning_phase` is deprecated and will be removed after 2020-10-11".

Please check the Tensorflow or other libraries version requirement for the above code to be supported to its used APIs. You can also refer to the [Object detection with Model Garden](https://www.tensorflow.org/tfmodels/vision/object_detection) which supports latest Tensorflow version. Thank you.
