Skip to content

Commit

Permalink
[DOCS] Fix the QNN TFLite tutorial build (apache#5641)
Browse files Browse the repository at this point in the history
* [TUTORIAL] Fix execution error of TFLite quantized tutorial

* Assign TensorCore to docs build
  • Loading branch information
tqchen authored May 21, 2020
1 parent cafb498 commit 1c355d3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ stage('Integration Test') {
}
},
'docs: GPU': {
node('GPU') {
node('TensorCore') {
ws(per_exec_ws("tvm/docs-python-gpu")) {
init_git()
unpack_lib('gpu', tvm_multilib)
Expand Down
9 changes: 7 additions & 2 deletions tutorials/frontend/deploy_prequantized_tflite.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,13 @@ def get_real_image(im_height, im_width):
tflite_model_file = os.path.join(model_dir, "mobilenet_v2_1.0_224_quant.tflite")
tflite_model_buf = open(tflite_model_file, "rb").read()

tflite_model = tflite.Model.GetRootAsModel(tflite_model_buf, 0)

# Get TFLite model from buffer
try:
import tflite
tflite_model = tflite.Model.GetRootAsModel(tflite_model_buf, 0)
except AttributeError:
import tflite.Model
tflite_model = tflite.Model.Model.GetRootAsModel(tflite_model_buf, 0)

###############################################################################
# Lets run TFLite pre-quantized model inference and get the TFLite prediction.
Expand Down

0 comments on commit 1c355d3

Please sign in to comment.