#include #include #include #include #include #include int main(int argc, char** argv) { if (argc != 2) { std::cerr << "usage: " << argv[0] << " MODEL.tflite\n"; return 2; } std::ifstream input(argv[1], std::ios::binary); if (!input) { std::cerr << "could not open model\n"; return 2; } std::vector bytes( (std::istreambuf_iterator(input)), std::istreambuf_iterator()); try { auto parser = armnnTfLiteParser::ITfLiteParser::Create(); auto network = parser->CreateNetworkFromBinary(bytes); if (!network) { std::cerr << "parser returned a null network\n"; return 3; } std::cout << "loaded " << bytes.size() << " bytes\n"; return 0; } catch (const std::exception& error) { std::cerr << "load failed: " << error.what() << '\n'; return 1; } }