The tensorflow:latest-py3container uses TensorFlow 2.0.0 which does not support GraphDef(). This causes the Image Classifier Service container to fail. Changing the import function to tensorflow.compat.v1 maintains support for TensorFlow <2.0.0 functionality and the container (and the solution) start successfully.
Does this introduce a breaking change?
[ ] Yes
[x] No
Pull Request Type
What kind of change does this Pull Request introduce?
[x] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Documentation content changes
[ ] Other... Please describe:
How to Test
Clone the original repo
Populate the .env file with Azure Container Registry information
Build and Push the IoT Edge solution containers
Deploy the solution from the config JSON
Monitor the containers on the IoT Edge device
The image-classifier-service container will fail on predict.py
Error is "module 'tensorflow' has no attribute 'GraphDef'
Other Information
There is a published article on migrating Tensorflow 1 code to Tensorflow 2. I have not included this in this PR, as the aim was just to get the original solution functional.
Purpose
The
tensorflow:latest-py3
container uses TensorFlow 2.0.0 which does not supportGraphDef()
. This causes the Image Classifier Service container to fail. Changing the import function totensorflow.compat.v1
maintains support for TensorFlow <2.0.0 functionality and the container (and the solution) start successfully.Does this introduce a breaking change?
Pull Request Type
What kind of change does this Pull Request introduce?
How to Test
.env
file with Azure Container Registry informationimage-classifier-service
container will fail onpredict.py
Other Information
There is a published article on migrating Tensorflow 1 code to Tensorflow 2. I have not included this in this PR, as the aim was just to get the original solution functional.