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

[TFLite] Model importer to be compatible with tflite 2.1.0 #5497

Merged
merged 4 commits into from
May 2, 2020

Conversation

tmoreau89
Copy link
Contributor

Summary of changes:

  • Make tflite importer compatible with old tflite (1.13) and 2.1.0
  • Update from_tflite.py tutorial to pip install tflite from PyPI repo for convenience, and update to 2.1.0

Tested from_tflite.py on environment with TFLite 2.1.0 and 1.13 to make sure we don't break backwards compatibility.

@tmoreau89 tmoreau89 requested a review from FrozenGene May 1, 2020 18:41
@tmoreau89
Copy link
Contributor Author

CC @tqchen @FrozenGene @u99127

@tmoreau89
Copy link
Contributor Author

@michalpiszczek

Copy link
Contributor

@u99127 u99127 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this - I've been scratching my head off and on about this in some of the failures I've been seeing with running through some of the tutorials.

Didn't realize there could be breaking API changes in tflite. !

Ramana

tests/python/frontend/tflite/test_forward.py Outdated Show resolved Hide resolved
@u99127
Copy link
Contributor

u99127 commented May 1, 2020

Summary of changes:

* Make tflite importer compatible with old tflite (1.13) and 2.1.0

* Update `from_tflite.py` tutorial to pip install tflite from PyPI repo for convenience, and update to 2.1.0

Tested from_tflite.py on environment with TFLite 2.1.0 and 1.13 to make sure we don't break backwards compatibility.

Do we need to keep compatibility with both tflite 2.1.0 and 1.13.0 or should we think about another CI pipeline for 1.13 compatibility ?

@tmoreau89
Copy link
Contributor Author

I think we should adopt/embrace 2.1.0 but not break existing deployments that depend on 1.13 IMO

@tqchen tqchen merged commit 8599f7c into apache:master May 2, 2020
@tmoreau89 tmoreau89 deleted the tflitefix branch May 2, 2020 22:40
Laurawly pushed a commit to Laurawly/tvm-1 that referenced this pull request May 9, 2020
windclarion pushed a commit to windclarion/incubator-tvm that referenced this pull request May 19, 2020
see commit 8599f7c
[TFLite] Model importer to be compatible with tflite 2.1.0 (apache#5497)

Signed-off-by: Taikang Hu <[email protected]>
windclarion pushed a commit to windclarion/incubator-tvm that referenced this pull request May 19, 2020
see commit 8599f7c
[TFLite] Model importer to be compatible with tflite 2.1.0 (apache#5497)

Signed-off-by: Taikang Hu <[email protected]>
windclarion pushed a commit to windclarion/incubator-tvm that referenced this pull request May 19, 2020
see commit 8599f7c
[TFLite] Model importer to be compatible with tflite 2.1.0 (apache#5497)

Signed-off-by: Taikang Hu <[email protected]>
windclarion pushed a commit to windclarion/incubator-tvm that referenced this pull request May 19, 2020
see commit 8599f7c
[TFLite] Model importer to be compatible with tflite 2.1.0 (apache#5497)

Signed-off-by: Taikang Hu <[email protected]>
windclarion pushed a commit to windclarion/incubator-tvm that referenced this pull request May 20, 2020
see commit 8599f7c
[TFLite] Model importer to be compatible with tflite 2.1.0 (apache#5497)

Signed-off-by: Taikang Hu <[email protected]>
windclarion pushed a commit to windclarion/incubator-tvm that referenced this pull request May 20, 2020
see commit 8599f7c
[TFLite] Model importer to be compatible with tflite 2.1.0 (apache#5497)

Signed-off-by: Taikang Hu <[email protected]>
windclarion pushed a commit to windclarion/incubator-tvm that referenced this pull request May 20, 2020
see commit 8599f7c
[TFLite] Model importer to be compatible with tflite 2.1.0 (apache#5497)

Signed-off-by: Taikang Hu <[email protected]>
windclarion pushed a commit to windclarion/incubator-tvm that referenced this pull request May 21, 2020
see commit 8599f7c
[TFLite] Model importer to be compatible with tflite 2.1.0 (apache#5497)

Signed-off-by: Taikang Hu <[email protected]>
windclarion pushed a commit to windclarion/incubator-tvm that referenced this pull request May 22, 2020
see commit 8599f7c
[TFLite] Model importer to be compatible with tflite 2.1.0 (apache#5497)

Signed-off-by: Taikang Hu <[email protected]>
windclarion pushed a commit to windclarion/incubator-tvm that referenced this pull request May 24, 2020
see commit 8599f7c
[TFLite] Model importer to be compatible with tflite 2.1.0 (apache#5497)

Signed-off-by: Taikang Hu <[email protected]>
windclarion pushed a commit to windclarion/incubator-tvm that referenced this pull request May 26, 2020
see commit 8599f7c
[TFLite] Model importer to be compatible with tflite 2.1.0 (apache#5497)

Signed-off-by: Taikang Hu <[email protected]>
windclarion pushed a commit to windclarion/incubator-tvm that referenced this pull request May 26, 2020
see commit 8599f7c
[TFLite] Model importer to be compatible with tflite 2.1.0 (apache#5497)

Signed-off-by: Taikang Hu <[email protected]>
windclarion pushed a commit to windclarion/incubator-tvm that referenced this pull request May 27, 2020
see commit 8599f7c
[TFLite] Model importer to be compatible with tflite 2.1.0 (apache#5497)

Signed-off-by: Taikang Hu <[email protected]>
windclarion pushed a commit to windclarion/incubator-tvm that referenced this pull request May 28, 2020
see commit 8599f7c
[TFLite] Model importer to be compatible with tflite 2.1.0 (apache#5497)

Signed-off-by: Taikang Hu <[email protected]>
windclarion pushed a commit to windclarion/incubator-tvm that referenced this pull request May 29, 2020
see commit 8599f7c
[TFLite] Model importer to be compatible with tflite 2.1.0 (apache#5497)

Signed-off-by: Taikang Hu <[email protected]>
windclarion pushed a commit to windclarion/incubator-tvm that referenced this pull request Jun 1, 2020
see commit 8599f7c
[TFLite] Model importer to be compatible with tflite 2.1.0 (apache#5497)

Signed-off-by: Taikang Hu <[email protected]>
windclarion pushed a commit to windclarion/incubator-tvm that referenced this pull request Jun 30, 2020
see commit 8599f7c
[TFLite] Model importer to be compatible with tflite 2.1.0 (apache#5497)

Signed-off-by: Taikang Hu <[email protected]>
windclarion pushed a commit to windclarion/incubator-tvm that referenced this pull request Jul 1, 2020
see commit 8599f7c
[TFLite] Model importer to be compatible with tflite 2.1.0 (apache#5497)

Signed-off-by: Taikang Hu <[email protected]>
windclarion pushed a commit to windclarion/incubator-tvm that referenced this pull request Jul 1, 2020
see commit 8599f7c
[TFLite] Model importer to be compatible with tflite 2.1.0 (apache#5497)

Signed-off-by: Taikang Hu <[email protected]>
windclarion pushed a commit to windclarion/incubator-tvm that referenced this pull request Jul 2, 2020
see commit 8599f7c
[TFLite] Model importer to be compatible with tflite 2.1.0 (apache#5497)

Signed-off-by: Taikang Hu <[email protected]>
windclarion pushed a commit to windclarion/incubator-tvm that referenced this pull request Jul 2, 2020
see commit 8599f7c
[TFLite] Model importer to be compatible with tflite 2.1.0 (apache#5497)

Signed-off-by: Taikang Hu <[email protected]>
windclarion pushed a commit to windclarion/incubator-tvm that referenced this pull request Jul 2, 2020
see commit 8599f7c
[TFLite] Model importer to be compatible with tflite 2.1.0 (apache#5497)

Signed-off-by: Taikang Hu <[email protected]>
windclarion pushed a commit to windclarion/incubator-tvm that referenced this pull request Jul 2, 2020
see commit 8599f7c
[TFLite] Model importer to be compatible with tflite 2.1.0 (apache#5497)

Signed-off-by: Taikang Hu <[email protected]>
windclarion pushed a commit to windclarion/incubator-tvm that referenced this pull request Jul 2, 2020
see commit 8599f7c
[TFLite] Model importer to be compatible with tflite 2.1.0 (apache#5497)

Signed-off-by: Taikang Hu <[email protected]>
windclarion pushed a commit to windclarion/incubator-tvm that referenced this pull request Jul 2, 2020
see commit 8599f7c
[TFLite] Model importer to be compatible with tflite 2.1.0 (apache#5497)

Signed-off-by: Taikang Hu <[email protected]>
windclarion pushed a commit to windclarion/incubator-tvm that referenced this pull request Jul 3, 2020
see commit 8599f7c
[TFLite] Model importer to be compatible with tflite 2.1.0 (apache#5497)

Signed-off-by: Taikang Hu <[email protected]>
windclarion pushed a commit to windclarion/incubator-tvm that referenced this pull request Jul 3, 2020
see commit 8599f7c
[TFLite] Model importer to be compatible with tflite 2.1.0 (apache#5497)

Signed-off-by: Taikang Hu <[email protected]>
windclarion pushed a commit to windclarion/incubator-tvm that referenced this pull request Jul 3, 2020
see commit 8599f7c
[TFLite] Model importer to be compatible with tflite 2.1.0 (apache#5497)

Signed-off-by: Taikang Hu <[email protected]>
windclarion pushed a commit to windclarion/incubator-tvm that referenced this pull request Jul 3, 2020
see commit 8599f7c
[TFLite] Model importer to be compatible with tflite 2.1.0 (apache#5497)

Signed-off-by: Taikang Hu <[email protected]>
windclarion pushed a commit to windclarion/incubator-tvm that referenced this pull request Jul 3, 2020
see commit 8599f7c
[TFLite] Model importer to be compatible with tflite 2.1.0 (apache#5497)

Signed-off-by: Taikang Hu <[email protected]>
windclarion pushed a commit to windclarion/incubator-tvm that referenced this pull request Jul 3, 2020
see commit 8599f7c
[TFLite] Model importer to be compatible with tflite 2.1.0 (apache#5497)

Signed-off-by: Taikang Hu <[email protected]>
windclarion pushed a commit to windclarion/incubator-tvm that referenced this pull request Jul 3, 2020
see commit 8599f7c
[TFLite] Model importer to be compatible with tflite 2.1.0 (apache#5497)

Signed-off-by: Taikang Hu <[email protected]>
windclarion pushed a commit to windclarion/incubator-tvm that referenced this pull request Jul 6, 2020
see commit 8599f7c
[TFLite] Model importer to be compatible with tflite 2.1.0 (apache#5497)

Signed-off-by: Taikang Hu <[email protected]>
windclarion pushed a commit to windclarion/incubator-tvm that referenced this pull request Jul 7, 2020
see commit 8599f7c
[TFLite] Model importer to be compatible with tflite 2.1.0 (apache#5497)

Signed-off-by: Taikang Hu <[email protected]>
windclarion pushed a commit to windclarion/incubator-tvm that referenced this pull request Jul 7, 2020
see commit 8599f7c
[TFLite] Model importer to be compatible with tflite 2.1.0 (apache#5497)

Signed-off-by: Taikang Hu <[email protected]>
windclarion pushed a commit to windclarion/incubator-tvm that referenced this pull request Jul 9, 2020
see commit 8599f7c
[TFLite] Model importer to be compatible with tflite 2.1.0 (apache#5497)

Signed-off-by: Taikang Hu <[email protected]>
windclarion pushed a commit to windclarion/incubator-tvm that referenced this pull request Jul 9, 2020
see commit 8599f7c
[TFLite] Model importer to be compatible with tflite 2.1.0 (apache#5497)

Signed-off-by: Taikang Hu <[email protected]>
windclarion pushed a commit to windclarion/incubator-tvm that referenced this pull request Jul 9, 2020
see commit 8599f7c
[TFLite] Model importer to be compatible with tflite 2.1.0 (apache#5497)

Signed-off-by: Taikang Hu <[email protected]>
windclarion pushed a commit to windclarion/incubator-tvm that referenced this pull request Jul 10, 2020
see commit 8599f7c
[TFLite] Model importer to be compatible with tflite 2.1.0 (apache#5497)

Signed-off-by: Taikang Hu <[email protected]>
windclarion pushed a commit to windclarion/incubator-tvm that referenced this pull request Jul 10, 2020
see commit 8599f7c
[TFLite] Model importer to be compatible with tflite 2.1.0 (apache#5497)

Signed-off-by: Taikang Hu <[email protected]>
windclarion pushed a commit to windclarion/incubator-tvm that referenced this pull request Jul 13, 2020
see commit 8599f7c
[TFLite] Model importer to be compatible with tflite 2.1.0 (apache#5497)

Signed-off-by: Taikang Hu <[email protected]>
windclarion pushed a commit to windclarion/incubator-tvm that referenced this pull request Jul 13, 2020
see commit 8599f7c
[TFLite] Model importer to be compatible with tflite 2.1.0 (apache#5497)

Signed-off-by: Taikang Hu <[email protected]>
windclarion pushed a commit to windclarion/incubator-tvm that referenced this pull request Jul 13, 2020
see commit 8599f7c
[TFLite] Model importer to be compatible with tflite 2.1.0 (apache#5497)

Signed-off-by: Taikang Hu <[email protected]>
windclarion pushed a commit to windclarion/incubator-tvm that referenced this pull request Jul 13, 2020
see commit 8599f7c
[TFLite] Model importer to be compatible with tflite 2.1.0 (apache#5497)

Signed-off-by: Taikang Hu <[email protected]>
wget https://github.com/FrozenGene/tflite/releases/download/v1.13.1/tflite-1.13.1-py2-none-any.whl
pip install -U tflite-1.13.1-py2-none-any.whl --user
# install tflite
pip install tflite=2.1.0 --user
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tmoreau89 pip command fails. We need to use == instead of =.

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

Successfully merging this pull request may close these issues.

4 participants