Azure-Samples / Custom-vision-service-iot-edge-raspberry-pi

Sample showing how to deploy a AI model from the Custom Vision service to a Raspberry Pi 3 device using Azure IoT Edge
MIT License
186 stars 135 forks source link

Change tf import to support Tensorflow 2.0.0 #59

Closed jamesbannan closed 4 years ago

jamesbannan commented 4 years ago

Purpose

The tensorflow:latest-py3 container 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

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.

jamesbannan commented 4 years ago

Hi @ebertrams - would you mind taking a look at this PR? Thanks

emmanuel-bv commented 4 years ago

Thank you!