C++ コマンドラインインターフェイス¶
Nnabla は C++ バージョンのコマンドラインインターフェイスを持っており、学習や推論 ( フォワード ) を実行できます。このコマンドラインインターフェイスを使うことで、開発者は python 環境がなくても学習や推論を実行できます。
usage: nbla (infer|dump|train)
基本機能¶
Forward¶
usage: nbla infer -e EXECUTOR [-b BATCHSIZE] [-o OUTPUT] input_files ...
arguments:
-e EXECUTOR EXECUTOR is the name of executor network.
input_files input_file must be one of followings.
*.nnp : Network structure and parameter.
*.nntxt : Network structure in prototxt format.
*.prototxt : Same as nntxt.
*.h5 : Parameters in h5 format.
*.protobuf : Network structure and parameters in binary.
*.bin : Input data.
optional arguments:
-b BATCHSIZE batch size for the input data.
-o OUTPUT the filename pattern of output file, default output to stdout.
example:
Infer using LeNet_input.bin as input, LeNet_output_0.bin as output:
nbla infer -e Executor -b 1 LeNet.nnp LeNet_input.bin -o LeNet_output
Infer and output the result to console:
nbla infer -e Executor -b 1 LeNet.nnp LeNet_input.bin
Dump¶
usage: nbla dump input_files ...
arguments:
input_files input_files must be one of *.nnp, *.nntxt, prototxt, h5, protobuf
example:
Show network information by dump command:
nbla dump LeNet.nnp
出力例 :
This configuration has 1 executors.
Executor No.0 Name [Executor]
Using default batch size 64 .
Inputs
Input No.0 Name [x] Shape ( 64 1 28 28 )
Outputs
Output No.0 Name [y'] Shape ( 64 10 )
Finished
学習¶
usage: nbla train input_file
arguments:
input_file input_file must be *.nnp