Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposed update MMdnn for TensorFlow v2 compatibility #918

Closed
vladmandic opened this issue Mar 1, 2021 · 1 comment
Closed

Proposed update MMdnn for TensorFlow v2 compatibility #918

vladmandic opened this issue Mar 1, 2021 · 1 comment

Comments

@vladmandic
Copy link

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

@vladmandic vladmandic changed the title Update MMdnn for TensorFlow v2 compatibility Proposed update MMdnn for TensorFlow v2 compatibility Mar 1, 2021
@vladmandic
Copy link
Author

closing as no update from maintainer for over a year.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant