-
Couldn't load subscription status.
- Fork 961
Description
I've created PR #917 that updates MMdnn for TensorFlow v2 compatibility by utilizing legacy support in TF2
Main reason is that TF1 requires Python 3.7 or lower and new systems come with Python 3.8 which I did not want to downgrade
Change is basically switching imports from tensorflow to tensorflow.compat.v1 and setting appropriate flags
Only additional change needed is definition of flatten layer as it has to be explicitly defined as legacy since contrib namespace no longer exists
Additional change in this PR is that emitted code does not use Inf constant as any constant may be undefined depending on the backend used
For example, Python or NodeJS with Tensorflow backend will resolve it fine, but GLSL code generated by TensorFlow/JS WebGL backend does not handle constants as constants in general do not exist in GLSL
I've tested this with converting Places365 ResNet152 model from Caffe to Tensorflow saved model and further using tensorflowjs_convert to convert this new TF saved model to TFJS graph model and then tested inference using NodeJS TensorFlow backend, WASM backend and WebGL backend