Tensorflow Error on Macbook M1 Pro - NotFoundError: Graph execution error

Written by- Aionlinecourse1595 times views

Tensorflow Error on Macbook M1 Pro - NotFoundError: Graph execution error

 You might follow this way to install packages but at the time of running the code, you are facing the "Not Found Error: Graph execution error". Today we will discuss why this error occurs, and what are the solutions to this error. 

First, let's understand why graph execution error occurs-

Graph execution error in Tensorflow indicates an issue with loading or executing a Tensorflow graph. This error is encountered because of some compatibility or installation issues. To overcome the issue, we can check whether the Tensorflow version is compatible or not. If the error comes during the execution of a specific model, then check the model's architecture and ensure that the model is compatible with your Tensorflow version. If GPU is used in your device, then check the necessary CUDA and cuDNN libraries are installed and configured for the device. Then check all the necessary dependencies are installed and configured with the device-configured version. 

If you are using Anaconda, then check the versions of TensorFlow.

conda list | grep tensorflow
tensorflow-deps           2.9.0                          0    apple
tensorflow-estimator 2.11.0 pypi_0 pypi
tensorflow-macos 2.11.0 pypi_0 pypi
tensorflow-metal 0.7.0 pypi_0 pypi

The version of Tensorflow you have installed does not match the Tensorflow dependencies, hence the error. The solution was to downgrade to the same version as the dependencies as well as downgrade tensorflow-metal:

pip install tensorflow-metal==0.5.0
pip install tensorflow-macos==2.9.0

Consulting the tensorflow-metal plugin documentation, tensorflow-macos 2.9.0 is the last known working version to interface successfully tensorflow-metal, and the documentation here lists that version 0.5.0 is the most supported. This resulted in the downgrading of both tensorflow-macos to 2.9.0 and tensorflow-metal to 0.5.0.

So, when a graph execution error occurs in Tensorflow, then check whether your Tensorflow version is compatible or not with your specific model. If you have a GPU, then check the CUDA and CuDNN have been installed and properly configured to your device. If you are using the latest version of libraries, then downgrade the version of the libraries. Hope the problem will be solved. Generally, the latest version can not handle all the issues or creates bugs in the program. So, a little downgrade and stable version is suitable for any task. Hope, this article helps you to resolve the issue. Remember, Every problem has a minimum of one solution. So, Be patient and stay tuned. Thanks.