You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2020/05/01 18:41:34 UTC
[GitHub] [incubator-tvm] tmoreau89 opened a new pull request #5497: [TFLite] Model importer to be compatible with tflite 2.1.0
tmoreau89 opened a new pull request #5497:
URL: https://github.com/apache/incubator-tvm/pull/5497
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.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-tvm] tmoreau89 commented on a change in pull request #5497: [TFLite] Model importer to be compatible with tflite 2.1.0
Posted by GitBox <gi...@apache.org>.
tmoreau89 commented on a change in pull request #5497:
URL: https://github.com/apache/incubator-tvm/pull/5497#discussion_r418736415
##########
File path: tests/python/frontend/tflite/test_forward.py
##########
@@ -79,12 +79,12 @@ def run_tvm_graph(tflite_model_buf, input_data, input_node, num_output=1, target
# TFLite.Model.Model has changed to TFLite.Model from 1.14 to 2.1
try:
import tflite.Model
- tflite_model = tflite.Model.GetRootAsModel(tflite_model_buf, 0)
- except ImportError:
- raise ImportError("The tflite package must be installed")
+ tflite_model = tflite.Model.Model.GetRootAsModel(tflite_model_buf, 0)
except AttributeError:
import tflite
- tflite_model = tflite.GetRootAsModel(tflite_model_buf, 0)
+ tflite_model = tflite.Mode.GetRootAsModel(tflite_model_buf, 0)
Review comment:
good catch, I'm going to rerun the unit tests in both environments to make sure things are not breaking
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-tvm] u99127 commented on a change in pull request #5497: [TFLite] Model importer to be compatible with tflite 2.1.0
Posted by GitBox <gi...@apache.org>.
u99127 commented on a change in pull request #5497:
URL: https://github.com/apache/incubator-tvm/pull/5497#discussion_r418725224
##########
File path: tests/python/frontend/tflite/test_forward.py
##########
@@ -79,12 +79,12 @@ def run_tvm_graph(tflite_model_buf, input_data, input_node, num_output=1, target
# TFLite.Model.Model has changed to TFLite.Model from 1.14 to 2.1
try:
import tflite.Model
- tflite_model = tflite.Model.GetRootAsModel(tflite_model_buf, 0)
- except ImportError:
- raise ImportError("The tflite package must be installed")
+ tflite_model = tflite.Model.Model.GetRootAsModel(tflite_model_buf, 0)
except AttributeError:
import tflite
- tflite_model = tflite.GetRootAsModel(tflite_model_buf, 0)
+ tflite_model = tflite.Mode.GetRootAsModel(tflite_model_buf, 0)
Review comment:
tflite.Model.GetRootAsModel ?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-tvm] u99127 commented on pull request #5497: [TFLite] Model importer to be compatible with tflite 2.1.0
Posted by GitBox <gi...@apache.org>.
u99127 commented on pull request #5497:
URL: https://github.com/apache/incubator-tvm/pull/5497#issuecomment-622567360
>
>
> 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 ?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-tvm] tmoreau89 commented on pull request #5497: [TFLite] Model importer to be compatible with tflite 2.1.0
Posted by GitBox <gi...@apache.org>.
tmoreau89 commented on pull request #5497:
URL: https://github.com/apache/incubator-tvm/pull/5497#issuecomment-622592024
I think we should adopt/embrace 2.1.0 but not break existing deployments that depend on 1.13 IMO
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-tvm] tmoreau89 commented on a change in pull request #5497: [TFLite] Model importer to be compatible with tflite 2.1.0
Posted by GitBox <gi...@apache.org>.
tmoreau89 commented on a change in pull request #5497:
URL: https://github.com/apache/incubator-tvm/pull/5497#discussion_r418764872
##########
File path: tests/python/frontend/tflite/test_forward.py
##########
@@ -79,12 +79,12 @@ def run_tvm_graph(tflite_model_buf, input_data, input_node, num_output=1, target
# TFLite.Model.Model has changed to TFLite.Model from 1.14 to 2.1
try:
import tflite.Model
- tflite_model = tflite.Model.GetRootAsModel(tflite_model_buf, 0)
- except ImportError:
- raise ImportError("The tflite package must be installed")
+ tflite_model = tflite.Model.Model.GetRootAsModel(tflite_model_buf, 0)
except AttributeError:
import tflite
- tflite_model = tflite.GetRootAsModel(tflite_model_buf, 0)
+ tflite_model = tflite.Mode.GetRootAsModel(tflite_model_buf, 0)
Review comment:
This exercises the tflite model importer specifically
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-tvm] tmoreau89 commented on a change in pull request #5497: [TFLite] Model importer to be compatible with tflite 2.1.0
Posted by GitBox <gi...@apache.org>.
tmoreau89 commented on a change in pull request #5497:
URL: https://github.com/apache/incubator-tvm/pull/5497#discussion_r418765043
##########
File path: tests/python/frontend/tflite/test_forward.py
##########
@@ -79,12 +79,12 @@ def run_tvm_graph(tflite_model_buf, input_data, input_node, num_output=1, target
# TFLite.Model.Model has changed to TFLite.Model from 1.14 to 2.1
try:
import tflite.Model
- tflite_model = tflite.Model.GetRootAsModel(tflite_model_buf, 0)
- except ImportError:
- raise ImportError("The tflite package must be installed")
+ tflite_model = tflite.Model.Model.GetRootAsModel(tflite_model_buf, 0)
except AttributeError:
import tflite
- tflite_model = tflite.GetRootAsModel(tflite_model_buf, 0)
+ tflite_model = tflite.Mode.GetRootAsModel(tflite_model_buf, 0)
Review comment:
maintained here: `python/tvm/relay/frontend/tflite.py`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-tvm] tmoreau89 commented on pull request #5497: [TFLite] Model importer to be compatible with tflite 2.1.0
Posted by GitBox <gi...@apache.org>.
tmoreau89 commented on pull request #5497:
URL: https://github.com/apache/incubator-tvm/pull/5497#issuecomment-622511307
CC @tqchen @FrozenGene @u99127
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-tvm] u99127 commented on a change in pull request #5497: [TFLite] Model importer to be compatible with tflite 2.1.0
Posted by GitBox <gi...@apache.org>.
u99127 commented on a change in pull request #5497:
URL: https://github.com/apache/incubator-tvm/pull/5497#discussion_r418742125
##########
File path: tests/python/frontend/tflite/test_forward.py
##########
@@ -79,12 +79,12 @@ def run_tvm_graph(tflite_model_buf, input_data, input_node, num_output=1, target
# TFLite.Model.Model has changed to TFLite.Model from 1.14 to 2.1
try:
import tflite.Model
- tflite_model = tflite.Model.GetRootAsModel(tflite_model_buf, 0)
- except ImportError:
- raise ImportError("The tflite package must be installed")
+ tflite_model = tflite.Model.Model.GetRootAsModel(tflite_model_buf, 0)
except AttributeError:
import tflite
- tflite_model = tflite.GetRootAsModel(tflite_model_buf, 0)
+ tflite_model = tflite.Mode.GetRootAsModel(tflite_model_buf, 0)
Review comment:
NP, is this a case for specifically running the tutorials once when we migrate versions of the frameworks ?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-tvm] tmoreau89 commented on pull request #5497: [TFLite] Model importer to be compatible with tflite 2.1.0
Posted by GitBox <gi...@apache.org>.
tmoreau89 commented on pull request #5497:
URL: https://github.com/apache/incubator-tvm/pull/5497#issuecomment-622520287
@michalpiszczek
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org