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

Update super_resolution.ipynb to resize the input tensor #467

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion lite/examples/super_resolution/ml/super_resolution.ipynb
Expand Up @@ -200,12 +200,16 @@
"\n",
"# Load TFLite model and allocate tensors.\n",
"interpreter = tf.lite.Interpreter(model_path=esrgan_model_path)\n",
"interpreter.allocate_tensors()\n",

"\n",
"# Get input and output tensors.\n",
"input_details = interpreter.get_input_details()\n",
"output_details = interpreter.get_output_details()\n",
"\n",
"#Resize the input tensor.\n",
"interpreter.resize_tensor_input(input_details[0]['index'],[1,50,50,3])\n",
"interpreter.allocate_tensors()\n",
"\n",
"# Run the model\n",
"interpreter.set_tensor(input_details[0]['index'], lr)\n",
"interpreter.invoke()\n",
Expand Down