You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by ma...@apache.org on 2022/03/31 19:24:13 UTC

[tvm] 03/03: fixed keras tutorial

This is an automated email from the ASF dual-hosted git repository.

masahi pushed a commit to branch ci-gpu-torch-1.11
in repository https://gitbox.apache.org/repos/asf/tvm.git

commit ecd4ba28d082473719b40671571e3dd2cff4cd82
Author: Masahiro Masuda <ma...@gmail.com>
AuthorDate: Thu Mar 31 19:48:22 2022 +0900

    fixed keras tutorial
---
 gallery/how_to/compile_models/from_keras.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/gallery/how_to/compile_models/from_keras.py b/gallery/how_to/compile_models/from_keras.py
index 182e769..1db2779 100644
--- a/gallery/how_to/compile_models/from_keras.py
+++ b/gallery/how_to/compile_models/from_keras.py
@@ -39,6 +39,7 @@ from tvm import te
 import tvm.relay as relay
 from tvm.contrib.download import download_testdata
 import keras
+import tensorflow as tf
 import numpy as np
 
 ######################################################################
@@ -65,7 +66,7 @@ else:
 
 
 weights_path = download_testdata(weights_url, weights_file, module="keras")
-keras_resnet50 = keras.applications.resnet50.ResNet50(
+keras_resnet50 = tf.keras.applications.resnet50.ResNet50(
     include_top=True, weights=None, input_shape=(224, 224, 3), classes=1000
 )
 keras_resnet50.load_weights(weights_path)
@@ -76,7 +77,7 @@ keras_resnet50.load_weights(weights_path)
 # A single cat dominates the examples!
 from PIL import Image
 from matplotlib import pyplot as plt
-from keras.applications.resnet50 import preprocess_input
+from tensorflow.keras.applications.resnet50 import preprocess_input
 
 img_url = "https://github.com/dmlc/mxnet.js/blob/main/data/cat.png?raw=true"
 img_path = download_testdata(img_url, "cat.png", module="data")