guichristmann / edge-tpu-tiny-yolo

Run Tiny YOLO-v3 on Google's Edge TPU USB Accelerator.
MIT License
102 stars 31 forks source link

Running into an issue with "Unsupported data type in custom op handler" #4

Closed tkg61 closed 4 years ago

tkg61 commented 4 years ago

Running into the error mentioned here while experimenting with the provided file in this repo (model, classes, etc):

https://github.com/google-coral/edgetpu/issues/44

Still new to the TPU. Do i need to change something or is the code needing to be edited?

Thanks!

tkg61 commented 4 years ago

Was able to make the following changes to get it to work by using tensorflow runtime (latest from google):

import tflite_runtime.interpreter as tflite

def make_interpreter(model_path, edge_tpu=False):
    # Load the TF-Lite model and delegate to Edge TPU
    if edge_tpu:
        interpreter = tflite.Interpreter(model_path=model_path,
                experimental_delegates=[
                    tflite.load_delegate(EDGETPU_SHARED_LIB)
                    ])
    else:
        interpreter = tflite.Interpreter(model_path=model_path)

    return interpreter