Closed thomas-baumela closed 2 years ago
Hello, Thank you for reporting this issue. This has been fixed in the latest commit (please wait a few hours for it to be published on github).
Actually, there was an issue with the Frame model, but it seems unrelated to the error you are getting. It seems that your "conv1" layer has no input (" Warning: output map #0 of "conv1" has no input connection."). Did you change anything else in the INI file?
Hello,
Thanks for getting on my problem.
The only thing I changed in the INI file (models/mnist24_16c4s2_24c5s2_150_10.ini) is the following :
-DefaultModel=Frame_CUDA
+DefaultModel=Frame
So just replacing Frame_CUDA
by Frame
The INI file until the conv1 layer looks like that :
$SIZE=24 │ ▸ AppFaceDetection/ | 31 ; Database
│ ▸ AppObjectRecognition/ | 32 [database]
DefaultModel=Frame │ ▸ AppRoadDetection/ | 33 Type=MNIST_IDX_Database
│ aer_cars.cpp | 34 Validation=0.2
; Database │ aer_viewer.cpp | 35
[database] │ n2d2.args | 36 ; Environment
Type=MNIST_IDX_Database │ n2d2.cpp* | 37 [sp]
Validation=0.2 │ n2d2.sh* | 38 SizeX=${SIZE}
│ n2d2_list_logo.hpp | 39 SizeY=${SIZE}
; Environment │ n2d2_live.cpp | 40 BatchSize=24
[sp] │ n2d2_live_fcnn.cpp | 41
SizeX=${SIZE} │ README.md | 42 [sp.Transformation]
SizeY=${SIZE} │ seed.dat | 43 Type=PadCropTransformation
BatchSize=24 │▸ export/ | 44 Width=[sp]SizeX
│▸ include/ | 45 Height=[sp]SizeY
[sp.Transformation] │▾ models/ | 46
Type=PadCropTransformation │ ▸ ONNX/ | 47 ; N2D2-IP only
Width=[sp]SizeX │ cifar-10.ini | 48 ;[sp.OnTheFlyTransformation]
Height=[sp]SizeY │ GTSRB29_32c4s1_32mp2_48c5s1| 49 ;Type=DistortionTransformation
│ ilsvrc2012_labels.dat | 50 ;ApplyTo=LearnOnly
; N2D2-IP only │ IMDBWIKI.ini | 51 ;ElasticGaussianSize=21
;[sp.OnTheFlyTransformation] │ IMDBWIKI_FasterRCNN.ini | 52 ;ElasticSigma=6.0
;Type=DistortionTransformation │ IMDBWIKI_target.dat | 53 ;ElasticScaling=36.0
;ApplyTo=LearnOnly │ IMDBWIKI_target_face.dat | 54 ;Scaling=10.0
;ElasticGaussianSize=21 │ IMDBWIKI_target_gender.dat | 55 ;Rotation=10.0
;ElasticSigma=6.0 │ LeNet.ini | 56
;ElasticScaling=36.0 │ LeNet_quant.ini | 57 ; First layer (convolutionnal)
;Scaling=10.0 │ LeNet_Spike.ini | 58 [conv1]
;Rotation=10.0 │ mnist-autoencoder.ini | 59 Input=sp
│ mnist-stdp-ijcnn.ini | 60 Type=Conv
; First layer (convolutionnal) │ mnist-stdp.ini | 61 KernelWidth=4
[conv1] │ mnist24_16c4s2_24c5s2_150_1| 62 KernelHeight=4
Input=sp │ mnist24_16c4s2_24c5s2_150_1| 63 NbOutputs=16
Type=Conv │ mnist24_16c4s2_24c5s2_150_1| 64 Stride=2
KernelWidth=4 │ mnist_ONNX.ini | 65 ActivationFunction=Rectifier
KernelHeight=4 │ MobileNet_v1.ini | 66 WeightsFiller=HeFiller
NbOutputs=16 │ MobileNet_v1_batchnorm.ini*| 67 ConfigSection=common.config
Stride=2 │ MobileNet_v1_batchnorm_gray| 68
ActivationFunction=Rectifier │ MobileNet_v1_ONNX.ini | 69 ; Second layer (convolutionnal)
WeightsFiller=HeFiller │ MobileNet_v1_ONNX_mxnet.ini| 70 [conv2]
ConfigSection=common.config
...
So it's really the same as in the repo except the frame model type set to Frame
.
EDIT: I tried the last commit (7402b3c) but the issue is still there.
I can't reproduce your issue. Could you post here the output of the command ./n2d2 -v
?
What is the OS you are using?
I'm using Ubuntu 20.04.2 LTS
Here's the output of n2d2 -v
Option -v: display version information
N2D2 (Jun 24 2021 09:47:35)
(C) Copyright 2010-2019 CEA LIST. All Rights Reserved.
GNU GCC/G++ compiler version: 9.3.0
General configuration for OpenCV 4.2.0 =====================================
Version control: unknown
Extra modules:
Location (extra): /build/opencv-YsXJoR/opencv-4.2.0+dfsg/contrib/modules
Version control (extra): unknown
Platform:
Timestamp: 2020-02-18T03:31:25Z
Host: Linux 4.4.0-173-generic x86_64
CMake: 3.16.3
CMake generator: Ninja
CMake build tool: /usr/bin/ninja
Configuration: Release
CPU/HW features:
Baseline: SSE SSE2
requested: SSE2
disabled: SSE3
Dispatched code generation: SSE4_1 SSE4_2 FP16 AVX AVX2 AVX512_SKX
requested: SSE4_1 SSE4_2 AVX FP16 AVX2 AVX512_SKX
SSE4_1 (13 files): + SSE3 SSSE3 SSE4_1
SSE4_2 (1 files): + SSE3 SSSE3 SSE4_1 POPCNT SSE4_2
FP16 (0 files): + SSE3 SSSE3 SSE4_1 POPCNT SSE4_2 FP16 AVX
AVX (4 files): + SSE3 SSSE3 SSE4_1 POPCNT SSE4_2 AVX
AVX2 (26 files): + SSE3 SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2
AVX512_SKX (3 files): + SSE3 SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2 AVX_512F AVX512_COMMON AVX512_SKX
C/C++:
Built as dynamic libs?: YES
C++ Compiler: /usr/bin/c++ (ver 9.2.1)
C++ flags (Release): -g -O2 -fdebug-prefix-map=/build/opencv-YsXJoR/opencv-4.2.0+dfsg=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -msse -msse2 -fvisibility=hidden -fvisibility-inlines-hidden -g -O2 -fdebug-prefix-map=/build/opencv-YsXJoR/opencv-4.2.0+dfsg=. -fstack-protector-strong -Wformat -Werror=format-security -DNDEBUG
C++ flags (Debug): -g -O2 -fdebug-prefix-map=/build/opencv-YsXJoR/opencv-4.2.0+dfsg=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -msse -msse2 -fvisibility=hidden -fvisibility-inlines-hidden -g -DDEBUG -D_DEBUG
C Compiler: /usr/bin/cc
C flags (Release): -g -O2 -fdebug-prefix-map=/build/opencv-YsXJoR/opencv-4.2.0+dfsg=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Winit-self -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -msse -msse2 -fvisibility=hidden -g -O2 -fdebug-prefix-map=/build/opencv-YsXJoR/opencv-4.2.0+dfsg=. -fstack-protector-strong -Wformat -Werror=format-security -DNDEBUG
C flags (Debug): -g -O2 -fdebug-prefix-map=/build/opencv-YsXJoR/opencv-4.2.0+dfsg=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Winit-self -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -msse -msse2 -fvisibility=hidden -g -DDEBUG -D_DEBUG
Linker flags (Release): -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -Wl,--gc-sections -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now
Linker flags (Debug): -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -Wl,--gc-sections
ccache: NO
Precompiled headers: NO
Extra dependencies: dl m pthread rt
3rdparty dependencies:
OpenCV modules:
To be built: aruco bgsegm bioinspired calib3d ccalib core datasets dnn dnn_objdetect dnn_superres dpm face features2d flann freetype fuzzy hdf hfs highgui img_hash imgcodecs imgproc java line_descriptor ml objdetect optflow phase_unwrapping photo plot python3 quality reg rgbd saliency shape stereo stitching structured_light superres surface_matching text tracking video videoio videostab viz ximgproc xobjdetect xphoto
Disabled: world
Disabled by dependency: sfm
Unavailable: cnn_3dobj cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev cvv gapi js matlab ovis python2 ts
Applications: apps
Documentation: doxygen python javadoc
Non-free algorithms: NO
GUI:
GTK+: YES (ver 3.24.13)
GThread : YES (ver 2.63.3)
GtkGlExt: NO
OpenGL support: NO
VTK support: YES (ver 6.3.0)
Media I/O:
ZLib: /usr/lib/x86_64-linux-gnu/libz.so (ver 1.2.11)
JPEG: /usr/lib/x86_64-linux-gnu/libjpeg.so (ver 80)
WEBP: /usr/lib/x86_64-linux-gnu/libwebp.so (ver encoder: 0x020e)
PNG: /usr/lib/x86_64-linux-gnu/libpng.so (ver 1.6.37)
TIFF: /usr/lib/x86_64-linux-gnu/libtiff.so (ver 42 / 4.1.0)
OpenEXR: /usr/lib/x86_64-linux-gnu/libImath.so /usr/lib/x86_64-linux-gnu/libIlmImf.so /usr/lib/x86_64-linux-gnu/libIex.so /usr/lib/x86_64-linux-gnu/libHalf.so /usr/lib/x86_64-linux-gnu/libIlmThread.so (ver 2.3.0)
GDAL: YES (/usr/lib/libgdal.so)
GDCM: YES (3.0.4)
HDR: YES
SUNRASTER: YES
PXM: YES
PFM: YES
Video I/O:
DC1394: YES (2.2.5)
FFMPEG: YES
avcodec: YES (58.54.100)
avformat: YES (58.29.100)
avutil: YES (56.31.100)
swscale: YES (5.5.100)
avresample: YES (4.0.0)
GStreamer: YES (1.16.2)
PvAPI: NO
v4l/v4l2: YES (linux/videodev2.h)
Parallel framework: TBB (ver 2020.1 interface 11101)
Trace: YES (built-in)
Other third-party libraries:
Lapack: NO
Eigen: YES (ver 3.3.7)
Custom HAL: NO
Protobuf: /usr/lib/x86_64-linux-gnu/libprotobuf.so (3.6.1)
OpenCL: YES (no extra features)
Include path: /usr/include/CL
Link libraries: Dynamic load
Python 3:
Interpreter: /usr/bin/python3 (ver 3.8.2)
Libraries: /usr/lib/x86_64-linux-gnu/libpython3.8.so (ver 3.8.2rc1)
numpy: /usr/lib/python3/dist-packages/numpy/core/include (ver 1.17.4)
install path: lib/python3.8/dist-packages
Python (for build): /usr/bin/python3
Java:
ant: /usr/bin/ant (ver 1.10.7)
JNI: /usr/lib/jvm/default-java/include /usr/lib/jvm/default-java/include/linux /usr/lib/jvm/default-java/include
Java wrappers: YES
Java tests: NO
Install to: /usr
-----------------------------------------------------------------
Very strange. I just tried without CUDA on GCC 9.4 and it works fine. Right now, the only thing I can think of is that your INI file has been altered some way...
Here's the INI file :
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; (C) Copyright 2017 CEA LIST. All Rights Reserved.
; Contributor(s): Olivier BICHLER (olivier.bichler@cea.fr)
;
; This software is governed by the CeCILL-C license under French law and
; abiding by the rules of distribution of free software. You can use,
; modify and/ or redistribute the software under the terms of the CeCILL-C
; license as circulated by CEA, CNRS and INRIA at the following URL
; "http://www.cecill.info".
;
; As a counterpart to the access to the source code and rights to copy,
; modify and redistribute granted by the license, users are provided only
; with a limited warranty and the software's author, the holder of the
; economic rights, and the successive licensors have only limited
; liability.
;
; The fact that you are presently reading this means that you have had
; knowledge of the CeCILL-C license and that you accept its terms.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; This network reaches ~99.4% recognition rate on MNIST test dataset with only
; 126kMAC/image and 60kB of memory (int-8 bits).
; Command:
; ./n2d2.sh "$N2D2_MODELS/mnist24_16c4s2_24c5s2_150_10.ini" -learn 40000000 -log 100000
$SIZE=24
DefaultModel=Frame
; Database
[database]
Type=MNIST_IDX_Database
Validation=0.2
; Environment
[sp]
SizeX=${SIZE}
SizeY=${SIZE}
BatchSize=24
[sp.Transformation]
Type=PadCropTransformation
Width=[sp]SizeX
Height=[sp]SizeY
; N2D2-IP only
;[sp.OnTheFlyTransformation]
;Type=DistortionTransformation
;ApplyTo=LearnOnly
;ElasticGaussianSize=21
;ElasticSigma=6.0
;ElasticScaling=36.0
;Scaling=10.0
;Rotation=10.0
; First layer (convolutionnal)
[conv1]
Input=sp
Type=Conv
KernelWidth=4
KernelHeight=4
NbOutputs=16
Stride=2
ActivationFunction=Rectifier
WeightsFiller=HeFiller
ConfigSection=common.config
; Second layer (convolutionnal)
[conv2]
Input=conv1
Type=Conv
KernelWidth=5
KernelHeight=5
NbOutputs=24
Stride=2
ActivationFunction=Rectifier
WeightsFiller=HeFiller
ConfigSection=common.config
Mapping(conv1)=\
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 1 \
1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 1 \
0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 1 1 \
0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 1 1 \
0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 1 1 \
0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 1 1 \
0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 1 1 \
0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 1 1 0 0 0 1 1 \
0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 1 1 0 0 1 1 \
0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 1 1 0 0 1 1 \
0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 1 1 0 1 1 \
0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 1 1 0 1 1 \
0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 1 1 1 1 \
0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 1 1 1 1 \
0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 1 1 1 \
0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 1 1
; Third layer (fully connected)
[fc1]
Input=conv2
Type=Fc
NbOutputs=150
ActivationFunction=Rectifier
WeightsFiller=HeFiller
ConfigSection=common.config
[fc1.drop]
Input=fc1
Type=Dropout
NbOutputs=[fc1]NbOutputs
; Output layer (fully connected)
[fc2]
Input=fc1.drop
Type=Fc
NbOutputs=10
ActivationFunction=Linear
WeightsFiller=XavierFiller
ConfigSection=common.config
[softmax]
Input=fc2
Type=Softmax
NbOutputs=[fc2]NbOutputs
WithLoss=1
[softmax.Target]
; Common config for static model
[common.config]
NoBias=1
WeightsSolver.LearningRate=0.01
WeightsSolver.Momentum=0.9
WeightsSolver.Decay=0.0005
Solvers.LearningRatePolicy=StepDecay
Solvers.LearningRateStepSize=[sp]_EpochSize
Solvers.LearningRateDecay=0.993
As you can see, the only thing I changed is the DefaultModel value.
I really just followed the online documentation. I use the binary generated in the 'build/bin' folder. Should I use some of the scripts located in the 'exec' folder ?
I found what is causing your issue! It's because of a bug when you compile without protobuf (and therefore ONNX support). This has been solved in the latest commit. I strongly suggest to install protobuf however so you can import ONNX models in N2D2.
Thanks again for your issue and sorry for the resolution delay.
I can confirm that it now works. I tried without installing protobuf and it works for non-ONNX models. I'll install protobuf for ONNX support.
Thank you for your help.
Hello CEA,
I am trying to get into your tool as a complete newbie using the online documentation and I ran into an issue while trying my first learning.
I'm on a ubuntu 20.04 LTS OS with all the prerequisite installed, except I don't want to use CUDA. After cloning the repo, I executed the following commands :
After that, I downloaded the stimuli's datasets using
./tools/install_stimuli.py
I edited the model
mnist24_16c4s2_24c5s2_150_10.ini
to replace theFrame_CUDA
default model byFrame
to (i guess) not use CUDA. The line looks likeDefaultModel=Frame
Finally, I ran a learning usingn2d2 "mnist24_16c4s2_24c5s2_150_10.ini" -learn 600000 -log 10000
as suggested by the documentation. But here, the learning fail and I got the following results :Any help would by much appreciated