| 1 | ### the comprehensive model loading api table |
| 2 | |
| 3 | |load from|alexnet.param|alexnet.param.bin|alexnet.bin| |
| 4 | |---|---|---|---| |
| 5 | |file path|load_param(const char*)|load_param_bin(const char*)|load_model(const char*)| |
| 6 | |file descriptor|load_param(FILE*)|load_param_bin(FILE*)|load_model(FILE*)| |
| 7 | |file memory|load_param_mem(const char*)|load_param(const unsigned char*)|load_model(const unsigned char*)| |
| 8 | |android asset|load_param(AAsset*)|load_param_bin(AAsset*)|load_model(AAsset*)| |
| 9 | |android asset path|load_param(AAssetManager*, const char*)|load_param_bin(AAssetManager*, const char*)|load_model(AAssetManager*, const char*)| |
| 10 | |custom IO reader|load_param(const DataReader&)|load_param_bin(const DataReader&)|load_model(const DataReader&)| |
| 11 | |
| 12 | ### points to note |
| 13 | |
| 14 | 1. Either of the following combination shall be enough for loading model |
| 15 | * alexnet.param + alexnet.bin |
| 16 | * alexnet.param.bin + alexnet.bin |
| 17 | |
| 18 | 2. Never modify Net opt member after loading |
| 19 | |
| 20 | 3. Most loading functions return 0 if success, except loading alexnet.param.bin and alexnet.bin from file memory, which returns the bytes consumed after loading |
| 21 | * int Net::load_param(const unsigned char*) |
| 22 | * int Net::load_model(const unsigned char*) |
| 23 | |
| 24 | 4. It is recommended to load model from Android asset directly to avoid copying them to sdcard on Android platform |
| 25 | |
| 26 | 5. The custom IO reader interface can be used to implement on-the-fly model decryption and loading |