google-coral / libedgetpu

Source code for the userspace level runtime driver for Coral.ai devices.
Apache License 2.0
179 stars 60 forks source link

Compatibility Guarantees with tf-lite #26

Closed saidinesh5 closed 3 years ago

saidinesh5 commented 3 years ago

We are trying to add support for libedgetpu in our software, and our options are:

1) Compile libedgetpu + tflite into a single static library (A bit of a pain with bazel currently) for our program and modify the interpreter with edgetpu delegate only when libedgetpu finds devices:

              context->edgetpu_devices = edgetpu_list_devices(&(context->edgetpu_device_count));

                if (context->edgetpu_device_count > 0) {
                    LOG_D("Edgetpu devices found. Trying to modify the interpreter to use the edgetpu delegate.");
                    const auto& device = context->edgetpu_devices[0];
                    TfLiteDelegate* delegate = edgetpu_create_delegate(device.type, device.path, nullptr, 0);
                    context->interpreter->ModifyGraphWithDelegate(std::unique_ptr<TfLiteDelegate, decltype(&edgetpu_free_delegate)>(delegate, &edgetpu_free_delegate));
                }

2) Compile tflite into our program, try to dlopen libedgetpu from the host system, and take the same code path. This option is attractive to us because we won't have to worry about statically linking / distributing libusb and licensing issues that come from that, build system becomes slightly easier.

We are wondering

hjonnala commented 3 years ago

Hi, we can't give any guarantee that libedgetpu released along with a tflite version is compatible with all the versions of tflite in the same major version.

Please refer to this page to build coral for your platform. https://coral.ai/docs/notes/build-coral/#required-components.

Thanks