Closed mchagneux closed 2 weeks ago
Hi again!
The USE_LIBTORCH
definition won’t have the desired effect in this case. Once a shared library is compiled, trying to change a definition afterwards won’t work anymore, as they are processed at compile time.
In this case, you have two options: either include anira
as a submodule in your project (check nn-inference-template as an example) or build anira
separately and include it as a "pre-built" library, as you're currently doing. In both case customize the build by setting ANIRA_WITH_ONNXRUNTIME
and ANIRA_WITH_TFLITE
to OFF
before configuring your CMake project.
Let me know if you need further assistance!
Oh alright, got it, thanks for the answer! If I simply want to not use the other backends, is it fine if I just give empty initializers in the constructors of the inference configs ? Like, just populate the libtorch fields.
Hi Mattis, for the anira version 0.1.3 this is not possible unfortunately. But the version on the develop branch does support to only pass models to some of the backends that had been included in anira. This new version also has many improvements and features such as multichannel support and multiple input and output tensor support. Also we did change the API a little (coherence between camelcase and snakecase) and the readme files are not fully up to date yet. But you can have a look at the examples in order to update your code to work with the new version. The readme files will also be updated soon and then we will have a major new release on the main branch. This will happen latest on Wednesday.
Question answered. Also added a feature to anira to allow submission of a model configuration for a single backend, even if the library is built with multiple backends. This is now available with anira v1.0.0.
Hi,
I'm trying to restrict my project to the libtorch backend for now for ease of use. I'm importing the pre-built anira library (0.1.2) via
find_package(anira REQUIRED)
, then settingthen adding include dirs and linking to the binaries, but this doesn't set the macro properly. Is there something else I should know or do ?