Skip to content

Instantly share code, notes, and snippets.

@aurotripathy
Created April 4, 2023 08:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aurotripathy/0eef74402032104417195ce8f0b6e0b5 to your computer and use it in GitHub Desktop.
Save aurotripathy/0eef74402032104417195ce8f0b6e0b5 to your computer and use it in GitHub Desktop.
missing depth2space op
import logging
import os
from furiosa import runtime
from furiosa.runtime import session
import numpy as np
LOGLEVEL = os.environ.get('FURIOSA_LOG_LEVEL', 'INFO').upper()
logging.basicConfig(level=LOGLEVEL)
def run_example():
runtime.__full_version__
path = './model_uint8.tflite'
# Load a model and compile the model
sess = session.create(str(path))
# Print the model summary
sess.print_summary()
# Print the first input tensor shape and dimensions
input_meta = sess.inputs()[0]
print(input_meta)
# Generate the random input tensor according to the input shape
# input = np.random.randint(0, 255, input_meta.shape, dtype=np.uint8)
input = np.random.randint(0, 255, input_meta.shape).astype("float32")
# Run the inference
outputs = sess.run(input)
print("== Output ==")
print(outputs)
print(outputs[0].numpy())
if __name__ == "__main__":
run_example()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment