You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've created PR #917 that updates MMdnn for TensorFlowv2 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
The text was updated successfully, but these errors were encountered:
vladmandic
changed the title
Update MMdnn for TensorFlow v2 compatibility
Proposed update MMdnn for TensorFlow v2 compatibility
Mar 1, 2021
I've created PR #917 that updates
MMdnn
forTensorFlow
v2 compatibility by utilizing legacy support in TF2Main 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
totensorflow.compat.v1
and setting appropriate flagsOnly additional change needed is definition of
flatten
layer as it has to be explicitly defined as legacy sincecontrib
namespace no longer existsAdditional change in this PR is that emitted code does not use
Inf
constant as any constant may be undefined depending on the backend usedFor 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 NodeJSTensorFlow
backend,WASM
backend andWebGL
backendThe text was updated successfully, but these errors were encountered: