Skip to content

Issues when importing to C++ #127

Description

@alkaf-ahmed

I'm having trouble when importing a simple DNN for MNIST to C++

Here's the content of the .ini file

DefaultModel=Frame_CUDA

; Database
[database]
Type=MNIST_IDX_Database
Validation=0.2 ; Use 20% of the dataset for validation

; Environment
[sp]
SizeX=32
SizeY=32
BatchSize=128

[sp.Transformation_1]
Type=RescaleTransformation
Width=[sp]SizeX
Height=[sp]SizeY

[fc1]
Input=sp
Type=Fc
NbOutputs=84
ActivationFunction=Rectifier
WeightsFiller=HeFiller
ConfigSection=common.config

[fc2]
Input=fc1
Type=Fc
NbOutputs=84
ActivationFunction=Rectifier
WeightsFiller=HeFiller
ConfigSection=common.config

[fc3]
Input=fc2
Type=Fc
NbOutputs=84
ActivationFunction=Rectifier
WeightsFiller=HeFiller
ConfigSection=common.config

[fc4]
Input=fc3
Type=Fc
NbOutputs=10
ActivationFunction=Linear
ConfigSection=common.config

[softmax]
Input=fc4
Type=Softmax
NbOutputs=[fc4]NbOutputs
WithLoss=1

[softmax.Target]

[common.config]
NoBias=1
WeightsSolver.LearningRate=0.05
WeightsSolver.Momentum=0.9
WeightsSolver.Decay=0.0005
Solvers.LearningRatePolicy=StepDecay
Solvers.LearningRateStepSize=[sp]_EpochSize
Solvers.LearningRateDecay=0.993
Solvers.Clamping=-1.0:1.0

Here's the output after quantizing and calibration when executing the following command : n2d2 conf.ini -seed 1 -w /dev/null -export CPP -calib -1 -nbbits 8

Output :

Quantizing free parameters:
  - fc1: 0.324863
  - fc2: 0.138924
  - fc3: 0.0325353
  - fc4: 0.00761959
  - softmax: 0.00761959
  Fuse scaling cells:
  Quantizing activations:
  - fc1: prev=1, act=3.67446, bias=0.324863
      quant=127, global scaling=11.3108 -> cell scaling=0.000696151
  - fc2: prev=11.3108, act=2.49301, bias=0.138924
      quant=127, global scaling=17.9452 -> cell scaling=0.00496297
  - fc3: prev=17.9452, act=0.993608, bias=0.0325353
      quant=127, global scaling=30.5394 -> cell scaling=0.00462683
  - fc4: prev=30.5394, act=0.546552, bias=0.00761959
      quant=255, global scaling=71.7299 -> cell scaling=0.00166963
  Fuse scaling cells:
  - fuse: fc1_rescale_act
  - fuse: fc2_rescale_act
  - fuse: fc3_rescale_act
  - fuse: fc4_rescale_act
  Scaling approximation [1]:
  - fc1: 0.000696151
  - fc2: 0.00496297
  - fc3: 0.00462683
  - fc4: 0.00166963
  Inputs quantization
  Done!
sh: 1: dot: not found
Exporting Test dataset to "export_CPP_int8/stimuli"....................
Generating CPP export to "export_CPP_int8":
-> Generating network
Fuse Padding...
sh: 1: dot: not found
-> Generating cell fc1
-> Generating cell fc2
-> Generating cell fc3
-> Generating cell fc4
-> Generating cell softmax
Invalid registrar key "Softmax"
Notice: Unused section  in INI file
Time elapsed: 6.2989 s
Error: bad_function_call

Any ideas ?

Thanks in advance

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions