This may allow the current source code to compile correctly
However, when the Onnxruntime version is greater than 1.13.0, the version number is different. For details, see the official website
In most cases, version number 6 will be used,1.12.x or later cannot be loaded effectively, and Android will run in a flash.
For instance, terminating with uncaught exception of type Ort::Exception: inference_session.cc:1086 LoadOrtModel The ORT format model version [6] is not supported this build 1.12.1
no member error occurs when I try to upgrade
Because the functions I mentioned above have been deprecated in the new version
// namespace wekws
/home/xiao/apk_example/android/app/src/main/cpp/kws/keyword_spotting.cc:38:35: error: no member named 'LookupCustomMetadataMap' in 'Ort::ModelMetadata'
This made me very upset and tried to change the source code to
cachedim = std::stoi(metadata.LookupCustomMetadataMapAllocated("cache_dim", allocator).get());
To my regret, an error that I suspect is out of memory was reported
terminating with uncaught exception of type Ort::Exception: Got invalid dimensions for input: input for the following indices
index: 2 Got: 80 Expected: 40
In this file onnxruntime_cxx_api.h
If I use version 1.12.x and below
char LookupCustomMetadataMap(const char key , OrtAllocator* allocator )const;
///< Wraps OrtApi :: ModelMetadataLookupCustomMetadataMap
This may allow the current source code to compile correctly However, when the Onnxruntime version is greater than 1.13.0, the version number is different. For details, see the official website In most cases, version number 6 will be used,1.12.x or later cannot be loaded effectively, and Android will run in a flash. For instance, terminating with uncaught exception of type Ort::Exception: inference_session.cc:1086 LoadOrtModel The ORT format model version [6] is not supported this build 1.12.1
no member error occurs when I try to upgrade Because the functions I mentioned above have been deprecated in the new version
// namespace wekws /home/xiao/apk_example/android/app/src/main/cpp/kws/keyword_spotting.cc:38:35: error: no member named 'LookupCustomMetadataMap' in 'Ort::ModelMetadata'
AllocatedStringPtr LookupCustomMetadataMapAllocated(const char key , OrtAllocator allocator) const; ///< Wraps OrtApi :: ModelMetadataLookupCustomMetadataMap
This made me very upset and tried to change the source code to cachedim = std::stoi(metadata.LookupCustomMetadataMapAllocated("cache_dim", allocator).get());
To my regret, an error that I suspect is out of memory was reported
terminating with uncaught exception of type Ort::Exception: Got invalid dimensions for input: input for the following indices index: 2 Got: 80 Expected: 40
Sent from PPHub