Skip to content

Commit

Permalink
update doc
Browse files Browse the repository at this point in the history
  • Loading branch information
nihui committed May 8, 2024
1 parent 58c3ad6 commit 779fba0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions docs/how-to-use-and-FAQ/quantized-int8-inference.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ If your model has multiple input nodes, you can use multiple list files and othe
./ncnn2int8 mobilenet-opt.param mobilenet-opt.bin mobilenet-int8.param mobilenet-int8.bin mobilenet.table
```

If you don’t need static quantization, ncnn supports RNN/LSTM/GRU dynamic quantization. In this case, you can omit the table file.

```shell
./ncnn2int8 rnn-model.param rnn-model.bin rnn-model-int8.param rnn-model-int8.bin
```

## use ncnn int8 inference

the ncnn library would use int8 inference automatically, nothing changed in your code
Expand Down
4 changes: 2 additions & 2 deletions tools/quantize/ncnn2int8.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,7 @@ int NetQuantize::fuse_requantize()

int main(int argc, char** argv)
{
if (argc != 6)
if (argc != 5 && argc != 6)
{
fprintf(stderr, "usage: %s [inparam] [inbin] [outparam] [outbin] [calibration table]\n", argv[0]);
return -1;
Expand All @@ -777,7 +777,7 @@ int main(int argc, char** argv)
const char* inbin = argv[2];
const char* outparam = argv[3];
const char* outbin = argv[4];
const char* int8scale_table_path = argv[5];
const char* int8scale_table_path = argc == 6 ? argv[5] : NULL;

NetQuantize quantizer;

Expand Down

0 comments on commit 779fba0

Please sign in to comment.