Skip to content

Commit 02c9df9

Browse files
committed
fixed keras tutorial
1 parent 2da5ccf commit 02c9df9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

gallery/how_to/compile_models/from_keras.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
import tvm.relay as relay
4040
from tvm.contrib.download import download_testdata
4141
import keras
42+
import tensorflow as tf
4243
import numpy as np
4344

4445
######################################################################
@@ -65,7 +66,7 @@
6566

6667

6768
weights_path = download_testdata(weights_url, weights_file, module="keras")
68-
keras_resnet50 = keras.applications.resnet50.ResNet50(
69+
keras_resnet50 = tf.keras.applications.resnet50.ResNet50(
6970
include_top=True, weights=None, input_shape=(224, 224, 3), classes=1000
7071
)
7172
keras_resnet50.load_weights(weights_path)
@@ -76,7 +77,7 @@
7677
# A single cat dominates the examples!
7778
from PIL import Image
7879
from matplotlib import pyplot as plt
79-
from keras.applications.resnet50 import preprocess_input
80+
from tensorflow.keras.applications.resnet50 import preprocess_input
8081

8182
img_url = "https://github.com/dmlc/mxnet.js/blob/main/data/cat.png?raw=true"
8283
img_path = download_testdata(img_url, "cat.png", module="data")

0 commit comments

Comments
 (0)