Created
April 4, 2023 08:41
-
-
Save aurotripathy/0eef74402032104417195ce8f0b6e0b5 to your computer and use it in GitHub Desktop.
missing depth2space op
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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