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

Written by - Aionlinecourse1912 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.

Recommended Projects

Deep Learning Interview Guide

Medical Image Segmentation With UNET

Have you ever thought about how doctors are so precise in diagnosing any conditions based on medical images? Quite simply,...

Computer Vision
Deep Learning Interview Guide

Build A Book Recommender System With TF-IDF And Clustering(Python)

Have you ever thought about the reasons behind the segregation and recommendation of books with similarities? This project is aimed...

Machine LearningDeep LearningNatural Language Processing
Deep Learning Interview Guide

Automatic Eye Cataract Detection Using YOLOv8

Cataracts are a leading cause of vision impairment worldwide, affecting millions of people every year. Early detection and timely intervention...

Computer Vision
Deep Learning Interview Guide

Crop Disease Detection Using YOLOv8

In this project, we are utilizing AI for a noble objective, which is crop disease detection. Well, you're here if...

Computer Vision
Deep Learning Interview Guide

Vegetable classification with Parallel CNN model

The Vegetable Classification project shows how CNNs can sort vegetables efficiently. As industries like agriculture and food retail grow, automating...

Machine LearningDeep Learning
Deep Learning Interview Guide

Banana Leaf Disease Detection using Vision Transformer model

Banana cultivation is a significant agricultural activity in many tropical and subtropical regions, providing a vital source of income and...

Deep LearningComputer Vision
Deep Learning Interview Guide

Credit Card Default Prediction Using Machine Learning Techniques

This project aims to develop and assess machine learning models in predicting customer defaults, assisting businesses in evaluating the risk...

Machine Learning