<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[probleme beim laden euronaler netze mit opencv]]></title><description><![CDATA[<p>Hallo, erstmal hoffe ich, das ich in dem Forum richtig bin, hatte überlegt den Thread evt. in &quot;Rund um die Programmierung&quot; zu packen, sah dann hier aber doch besser aus.</p>
<p>So, jetzt zu meinem Problem:</p>
<p>Ich habe mit der OpenCv Klasse CvANN_MLP ein neuronaes Netz trainiert und die Parameter als xml Datei gespeichert. Bis hier hin funktioniert alles.</p>
<p>Jetzt will ich das gespeicherte Neuronale Netz laden</p>
<pre><code>CvANN_MLP xfuncApprox; // in Header

//in cpp
CvFileStorage* fs=cvOpenFileStorage(&quot;/pfad/zur/datei.xml&quot;, 0, CV_STORAGE_READ );
CvFileNode* annInNode1;
xfuncApprox.read(fs, annInNode1);
cvReleaseFileStorage(&amp;fs);
</code></pre>
<p>die funktion read() scheint die datei auch richtig einzulesen, aber read() will dann aus der Datei das Neuronale Netz erstellen und dabei läuft's schief und ich bekomme zur Laufzeit folgenden Fehler:<br />
OpenCV Error: Bad argument (The array of layer neuron counters must be an integer vector) in CvANN_MLP::create, file /tmp/buildd/libopencv-2.3.0+svn5720+trunk/modules/ml/src/ann_mlp.cpp, line 230<br />
terminate called after throwing an instance of 'cv::Exception'<br />
what(): /tmp/buildd/libopencv-2.3.0+svn5720+trunk/modules/ml/src/ann_mlp.cpp:230: error: (-5) The array of layer neuron counters must be an integer vector in function CvANN_MLP::create</p>
<p>Also erkennt er nicht, dass es sich dabei um ein Vektor handelt in dem die Neuronen pro Layer stehen<br />
Wenn jemand eine Idee hat, wodran das liegen kann bin ich für jede Hilfe dankbar.</p>
<p>Hier noch ein Auszug aus dem xml File, was eingelesen werden soll:</p>
<pre><code>&lt;opencv_storage&gt;
&lt;test type_id=&quot;opencv-ml-ann-mlp&quot;&gt;
  &lt;layer_sizes type_id=&quot;opencv-matrix&quot;&gt;
    &lt;rows&gt;1&lt;/rows&gt;
    &lt;cols&gt;5&lt;/cols&gt;
    &lt;dt&gt;i&lt;/dt&gt;
    &lt;data&gt;
      6 15 15 15 1&lt;/data&gt;&lt;/layer_sizes&gt;
  &lt;activation_function&gt;SIGMOID_SYM&lt;/activation_function&gt;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/289560/probleme-beim-laden-euronaler-netze-mit-opencv</link><generator>RSS for Node</generator><lastBuildDate>Wed, 19 Aug 2026 02:53:19 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/289560.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 07 Jul 2011 18:10:24 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to probleme beim laden euronaler netze mit opencv on Thu, 07 Jul 2011 18:10:24 GMT]]></title><description><![CDATA[<p>Hallo, erstmal hoffe ich, das ich in dem Forum richtig bin, hatte überlegt den Thread evt. in &quot;Rund um die Programmierung&quot; zu packen, sah dann hier aber doch besser aus.</p>
<p>So, jetzt zu meinem Problem:</p>
<p>Ich habe mit der OpenCv Klasse CvANN_MLP ein neuronaes Netz trainiert und die Parameter als xml Datei gespeichert. Bis hier hin funktioniert alles.</p>
<p>Jetzt will ich das gespeicherte Neuronale Netz laden</p>
<pre><code>CvANN_MLP xfuncApprox; // in Header

//in cpp
CvFileStorage* fs=cvOpenFileStorage(&quot;/pfad/zur/datei.xml&quot;, 0, CV_STORAGE_READ );
CvFileNode* annInNode1;
xfuncApprox.read(fs, annInNode1);
cvReleaseFileStorage(&amp;fs);
</code></pre>
<p>die funktion read() scheint die datei auch richtig einzulesen, aber read() will dann aus der Datei das Neuronale Netz erstellen und dabei läuft's schief und ich bekomme zur Laufzeit folgenden Fehler:<br />
OpenCV Error: Bad argument (The array of layer neuron counters must be an integer vector) in CvANN_MLP::create, file /tmp/buildd/libopencv-2.3.0+svn5720+trunk/modules/ml/src/ann_mlp.cpp, line 230<br />
terminate called after throwing an instance of 'cv::Exception'<br />
what(): /tmp/buildd/libopencv-2.3.0+svn5720+trunk/modules/ml/src/ann_mlp.cpp:230: error: (-5) The array of layer neuron counters must be an integer vector in function CvANN_MLP::create</p>
<p>Also erkennt er nicht, dass es sich dabei um ein Vektor handelt in dem die Neuronen pro Layer stehen<br />
Wenn jemand eine Idee hat, wodran das liegen kann bin ich für jede Hilfe dankbar.</p>
<p>Hier noch ein Auszug aus dem xml File, was eingelesen werden soll:</p>
<pre><code>&lt;opencv_storage&gt;
&lt;test type_id=&quot;opencv-ml-ann-mlp&quot;&gt;
  &lt;layer_sizes type_id=&quot;opencv-matrix&quot;&gt;
    &lt;rows&gt;1&lt;/rows&gt;
    &lt;cols&gt;5&lt;/cols&gt;
    &lt;dt&gt;i&lt;/dt&gt;
    &lt;data&gt;
      6 15 15 15 1&lt;/data&gt;&lt;/layer_sizes&gt;
  &lt;activation_function&gt;SIGMOID_SYM&lt;/activation_function&gt;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2090040</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2090040</guid><dc:creator><![CDATA[Schlangenmensch]]></dc:creator><pubDate>Thu, 07 Jul 2011 18:10:24 GMT</pubDate></item><item><title><![CDATA[Reply to probleme beim laden euronaler netze mit opencv on Thu, 07 Jul 2011 18:22:18 GMT]]></title><description><![CDATA[<p>Hallo Kontortionist. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
<p>Mittlerweile gibts ein so schickes C++-Interface in OpenCV. Bist du durch irgendwas gezwungen, das ekelige C-Interface zu benutzen? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61b.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_tongue"
      title=":P"
      alt="😛"
    /></p>
<p>Hast du gerade ein kompilierbares Minimalbeispiel (incl. vollständiger minimaler XML/YML-Datei) zur Hand? Das würde die Fehlersuche ziemlich erleichtern.</p>
<p>Gruß<br />
Dobi</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2090043</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2090043</guid><dc:creator><![CDATA[Dobi]]></dc:creator><pubDate>Thu, 07 Jul 2011 18:22:18 GMT</pubDate></item><item><title><![CDATA[Reply to probleme beim laden euronaler netze mit opencv on Thu, 07 Jul 2011 20:21:01 GMT]]></title><description><![CDATA[<p>Danke für die schnelle Antwort</p>
<p>lauffähiges minimial bsp:</p>
<pre><code>#include &lt;opencv/cxcore.h&gt;
#include &lt;opencv/cv.h&gt;
#include &lt;opencv/ml.h&gt;

int main(int argc, char** argv)
{
	CvANN_MLP xfuncApprox=CvANN_MLP();
	CvFileStorage* fs=cvOpenFileStorage(&quot;netX0.yml&quot;, 0, CV_STORAGE_READ );
	CvFileNode* annInNode1;

	xfuncApprox.read(fs, annInNode1);
}
</code></pre>
<p>Vollständige YML Datei:</p>
<pre><code>%YAML:1.0
test: !!opencv-ml-ann-mlp
   layer_sizes: !!opencv-matrix
      rows: 1
      cols: 5
      dt: i
      data: [ 6, 15, 15, 15, 1 ]
   activation_function: SIGMOID_SYM
   f_param1: 0.6666666666666666
   f_param2: 1.7159000000000000
   min_val: -0.9500000000000000
   max_val: 0.9500000000000000
   min_val1: -0.9800000000000000
   max_val1: 0.9800000000000000
   training_params:
      train_method: RPROP
      dw0: 0.1000000000000000
      dw_plus: 1.2000000000000000
      dw_minus: 0.5000000000000000
      dw_min: 1.1920928955078125e-07
      dw_max: 50.
      term_criteria: { epsilon:9.9999997764825821e-03, iterations:1000 }
   input_scale: [ 4.4165076217830324, -2.2624039053756881,
       8.6164692216653620, -0.2551916437765352, 0.9897147792006876,
       -2.2754457759691014, 2.5766684597671601, -0.2459778856136816,
       8.1897470885483408, -0.1610103281432184, 0.2506005703085421,
       -4.1926283801555577 ]
   output_scale: [ 15.0271184820877881, 14.2757625579833984 ]
   inv_output_scale: [ 0.0665463575862526, -0.9500000000000000 ]
   weights:
      - [ -0.3907472443195240, 0.5184953221844864, 0.3572608890145795,
          -0.3156419791084107, 0.1980854039137582, 0.3715834574718190,
          7.2536001014442215, -0.0763611902808841, -0.4060430540720730,
          -1.1977973826819932, 0.0972826973559214, 1.6323637200029106,
          -0.0763257648164157, -0.1529884291981157, 0.1605035067051817,
          -0.4709090702315137, 0.2553605156862818, 0.0868607373515501,
          0.5954092550250069, 0.3622866244487224, -0.1191384006349801,
          4.2010880591922968, -0.1535620911161984, 0.4840253655894630,
          0.7095998296015862, 0.0453480592826113, -1.4899645937548680,
          0.1060020853512352, -0.9339356878739407, 0.5219241759765607,
          0.6200727394985223, -0.3863220155786486, 0.0928829740603402,
          0.2988841869556569, -0.2240825752080189, -0.2394418714664813,
          -0.6452298920648190, 0.2440644985816788, 0.4304382168892077,
          1.6604644843923564, -0.5237102274867949, 0.2359611455113001,
          2.2359907218696353, 1.7228230426446733, 0.0303101413826011,
          1.2797653820977446, 0.4509429859510810, 0.1570610513162197,
          0.5418375161077819, 0.3184387806790505, 0.2872495874051180,
          -6.8260569169926288, 0.2298204181939010, -0.0442624642425255,
          0.7707780314308668, 0.2856769739131934, 0.7607003435917576,
          1.5795514907155277, 1.3560184247286418, 0.2204329874768528,
          0.3094185413517798, -0.1285838426169442, 0.1715306972887650,
          0.0431432409877097, 0.3780037371457112, 0.1997379936794739,
          1.8244415294956313, -0.7224951971050779, 0.7735896942301548,
          -2.3877390300411494, 0.2880180092088995, -1.3340195550772953,
          -0.5801643199462321, 1.3415538226819117, -0.4814664106710172,
          0.1551196516029911, -0.0482929656262565, 0.6847036509685454,
          -0.1076322199677444, -0.0602319709792233, 0.5650092335450504,
          -4.8118428810747016, 0.3322335617265804, 0.1122522416057727,
          1.9486740672983325, 0.0299044877261693, 1.2357589397261948,
          -1.3904622131737505, -1.4966711729831703, 0.7202955991298207,
          1.1237310277417338, 0.4081209201395204, -0.3496668778052557,
          -0.1790148820522929, 0.2135262452969077, 0.1153788374655638,
          -1.0494138077841006, 0.1994163138674745, -0.0565629454842588,
          0.7711166489839653, 0.4933953766865564, 0.3233620171349986,
          0.6099289928149882, 6.0938673682235239e-03,
          -0.8990112021097119 ]
      - [ -0.8314517254978744, -0.1313967951526770, -0.2409645831327689,
          -1.2675251461775507, -2.5025016117785903e-03,
          0.1428153279707209, 0.0967431601965923, 0.0963030918123224,
          -1.7787329989959173, 3.2051148409085930, 0.3344234639578880,
          0.3429137868841489, 0.4082681195704209, 0.1662415585299439,
          -0.3277813853067634, 0.5948170099126487, 0.2519094166178264,
          0.0437459292931136, -1.1176288301651485, 0.3852757716355410,
          0.3685935172420243, -0.1054939446031779, -0.0429557374621194,
          1.9132681491865271, -3.6470436944647919, 0.2087161486963151,
          -0.7578577208905942, -0.2179376048628358, 0.4731616222777587,
          0.1752896941706536, -0.3835033517629314, -0.2406791243135295,
          0.1904377541581329, -0.1250360719741849, 0.2965578168853504,
          0.1776699531175127, 0.1001219991446429, 0.2734500215298937,
          -1.0863611961810806, -0.7433861999630519, -0.3348136893316436,
          -1.2686578921241365, 0.1607308189298701, -0.2775904674551538,
          0.3533855592706638, -0.6365811303663664, -0.9714109171695511,
          -0.2086052081500454, 0.9637742327574856, 0.0478472580203699,
          -0.2682290372915577, -0.0221281428240827, 0.5198445219615710,
          -0.6357520336879355, 1.2766792328988781, 0.3947679276432156,
          1.2196715213160614, 0.1234516481489099, 0.9169308893875519,
          0.4115336696902909, 0.4273553715077835, -1.0306216057960080,
          -0.0778694232971638, -1.2058152732798533, -0.7918418391184311,
          0.3170207517046943, -0.0894775913170924, 0.3499338960085618,
          -2.5014452963006417, 1.8599148080912660, 0.0927947301814519,
          0.2427497405828527, 0.1296430683313744, 0.3722786433502581,
          -0.0548350003839809, 0.3431743504699386, 1.1473532648442557,
          7.5186541953945370e-03, -1.6923984275796211,
          0.1819517363763267, 0.4050516137910293, 0.2390926432172134,
          0.2320572400640049, 3.8065425694275783, -0.9682420537025133,
          0.0675870986698188, -0.8533343403267604, 0.1658693623386135,
          -0.5674585472401893, 0.3049651867912187, 0.9148804952380603,
          0.9989732884119289, -0.0431361099945527, 0.6291598380938702,
          -0.4649254870607139, 0.5302427695295426, 0.2808128238824027,
          -0.3928949680969254, 0.4160727410788868, -3.2907349691349737,
          -0.2358282997602347, -0.9521373264483692, 0.1081751473656965,
          0.0738765186111164, 0.2662431125073064, 0.6841504628285067,
          0.5779204496800220, 0.0440146175491573, 0.6368095483669096,
          -9.0004517267847084e-04, -0.2297164184114844,
          0.2084775111402333, 0.0976333538482139, -2.6360691980726134,
          -2.0854122715992447, 0.1552331362105470, 0.5477638190970626,
          -0.2328570453187190, -0.2026659374416586, 0.6340748420539899,
          0.4409580730710316, -1.0124024900193465, -0.2238713223146930,
          1.2856298534350270, 0.0732870157410851, -0.3734649330748739,
          -0.2238542980837989, -0.1460739932696151, -3.3801855886763850,
          0.4222282145554120, 0.4887169836730631, 0.2802765441395429,
          0.1666205657071364, 0.8230458918732595, -0.1914287036210938,
          -0.0540677123060622, 0.3264994408175428, 0.2829201673795978,
          -0.1787701346926157, 0.9115671360551421, 0.2197258512016234,
          0.1347951690559977, 0.4301768710097092, -1.4316955877984050,
          -1.4126808193400804, 0.1983328013558824, -0.5298321171845154,
          0.2532627437563237, -0.3632627813184778, 0.1402565637225242,
          -0.4966828945332897, -0.4229783735847096, 0.0929006616347860,
          -0.9175004690359662, -0.8064468347088458, 0.4507054100835974,
          0.4144182292655302, 0.2118843146029211, 2.3475355152123387,
          3.0110775437880695, -0.0682716053815364, 0.8268231406688721,
          0.6382664386843215, 0.3354103143079571, -0.1281604647322442,
          -0.0152073173559182, 1.1059731391684415, 0.5619575366262045,
          -0.4409784039935259, 0.3199625448248705, -0.1600452548542484,
          0.0127989200305369, -0.1825314172035996, 3.7883245590874948,
          0.7562982704990454, -0.3320077318386652, 1.2392103030959203,
          0.4531023875703544, -1.0535781336846461, 0.5940533364123343,
          0.3931221835204771, -0.9970316713566103, 0.1487920678886313,
          1.3776435225624406, 0.9098496490853788, -0.2696989935786347,
          0.5113120530090847, 0.2846465451105338, -1.4065324755514619,
          -2.3629193119932186, 0.6020594801309237, 0.9691652544526963,
          -0.0891095581001501, -0.1503303172721778, -0.0583984183429893,
          -0.4436101459678441, 1.1076826308407588, -0.4557512551932328,
          0.5516579080834839, -0.1818715502657796, -0.2118274883081552,
          0.4106098837513968, -0.1405828645455491, 2.9697736654568163,
          2.9227967124815679, -0.1373860745680755, 1.3376862049253528,
          -0.5789890559381523, -0.2845517801818840, 0.1541406585047082,
          -4.8536687581601512e-03, 1.4363893470116564,
          -0.4121894866425613, -0.2877061464007507, -0.0558106706858370,
          -0.1288430691217904, -0.3251284158654791, -0.2383908753699233,
          0.6907371758148009, 2.6707096969750417, 0.1076756303610497,
          -1.1283409181881345, -0.2774970361831640, -0.7911074737436581,
          -0.2069386507366185, 0.6541907996316486, -1.0525472018061151,
          0.3681070254542384, -0.3217349710214678, 0.2933081607269060,
          0.2998744699329303, -4.4810206108525756e-03,
          -0.3197207944979073, -0.0450467403167824, -0.6229501260392899,
          -0.3853342152989842, -0.2066648259065790, 0.0975894209185380,
          0.3616242897741923, -0.1694369028028419 ]
      - [ 0.0658610238320593, 0.2080061367802800, -0.0929641767703761,
          0.0940812433658316, 0.0407332858738176, 0.1243260567348303,
          -1.8154695901820266, -0.2831915368261830, 0.2883539615572391,
          -7.5141881344574814e-03, -0.1698377689611154,
          -0.4226724154949684, 0.2255889995552384, 0.2531461143425537,
          0.9885174783402393, -0.4141435184241011, 0.2224273817485221,
          -0.0311970139928456, 0.2905313800801319, -0.0814212532103054,
          0.2102514054657015, 2.5713658714672496, -0.0690338538540103,
          -0.1247645811499711, 0.1053874160476679, -0.1489230806731883,
          0.6834505808872527, -0.1876287455392271, -0.0364771470593291,
          -0.2394164865775394, 0.2596397241956760, 0.2309248242807630,
          0.2123945119496393, 0.0490964483551262, -0.0109501472941782,
          -0.2272396802122032, 0.8148766406298081, 0.4690531098929374,
          -0.0313697181289383, 0.3478223470737706, -0.2731376457889756,
          -0.2546042430440388, -0.1677472550820439, 0.4039644840104882,
          1.2392642695042135, 0.1928524078083901, 0.2886746453630167,
          -0.4234508973339979, 0.0906990219626351, 0.2131780752498025,
          0.3121382016661615, -0.1499753348227841, 0.2316480177422484,
          0.2330993287230838, -0.0160378741399263, 0.1578486147152956,
          0.1898954823640768, 0.0795875979158866, 0.6085932871840234,
          0.3775428252285390, 0.1244633659390624, -0.3328019487310133,
          0.4953676238967886, 0.1801069369032581, -0.0395540296839919,
          -0.2682020259484135, -0.1427389606818924, 0.2767078542839830,
          0.0567813309019041, 0.1629844543749612, 0.1445361757031033,
          0.1874261756159148, -0.0836696881349874, -0.5902204898011443,
          -1.3637698135319394, -0.7581603790493577, 0.3308468730283175,
          -0.3305230663825799, -0.1951806714134322, 0.1686430837823738,
          0.2245427888499710, -2.8280647721868348, -0.3986881939327748,
          0.0743943131388959, 0.0671870693799654, 0.0855497279319211,
          -0.7921892747331134, 0.0379376897058596, 0.6601459456790036,
          1.6393083184654444, -0.0816791824213812, 0.2025716579248807,
          -0.3377784780758307, 0.5086229883113513, -0.1028231787308142,
          -0.5016875864618693, -1.4286345177005821, 0.3486461275903100,
          -0.3695703210153354, 0.1525340878537443, 0.3673177761392007,
          -0.6315835272082159, 0.4260007264019895, -0.2834327429431884,
          0.7999862424109269, 1.0001369333167867, -0.4197975852408406,
          0.3998957737867994, -0.1555579365089771, 0.1749415043798725,
          0.0737895756241026, 0.5176727529921139, -0.0459576996743069,
          0.1392877095766434, 0.2194468310772332, -0.2541600029439127,
          -0.5067507748153526, 0.5557504819326839, -0.5914117855257967,
          -0.1633375680742362, -0.0717410340104294, 0.0309947330488415,
          -0.0608469613732211, -0.0446208780311337, 0.0754547645180259,
          0.3927222564271223, 1.9136195766739834,
          -3.1035412907746696e-03, 0.2477403141940046,
          -0.3087947437546839, 0.4316709711221002, 1.0917881469444750,
          -6.9420678923278467e-03, 0.1873210796153897,
          -1.6898116802219001, 0.9726054625829401, -0.1893263802347400,
          0.6124969453555003, 0.2753272469328152, 0.1078702455761966,
          -0.0359260701048627, 0.9781289560191019, -0.5248852955230771,
          0.1208300773761720, 0.0291783866619863, 0.3452255294207399,
          -0.0710342547634362, 0.3964523608140880, -0.6270698131416884,
          0.4701753144754124, 0.6258090421082553, 0.1546957398883942,
          0.8740579879305548, 0.2494574810934088, 0.2159912097850404,
          0.1923542796272785, -0.0112846553324457, 0.3610467214171751,
          0.0176041266507845, 0.2306997005435695, 0.3696767373142019,
          -0.4633868173563631, 0.2656433878501168,
          -3.0038851635829644e-03, -1.0953895158894447,
          -0.2841972472195740, -0.2547510158597988, 0.4324106949853516,
          0.4826638920536071, -0.0775430440404236, -0.4358997362488128,
          -2.3925007806734708, 0.2148088183556656, -0.0639669982771080,
          0.3367673509678341, 0.0275513965268370, -0.0179544593034028,
          0.3242524697034523, 0.4492742355090489, -0.8387679053508327,
          -0.2941771358077782, 0.4043491227311465, -0.2272394090254931,
          0.0337601026565314, 0.1097747645587274, 0.0323480836870794,
          2.3094552182307888, 0.4142636843115994, -0.1743777301872401,
          0.2394812458530304, -0.1168696703089222, 0.2192648522041808,
          0.0747708704413139, 0.3495796107304944, 0.6134948172478392,
          -0.1851146109656284, 0.2678006256455356, -0.3907444082750304,
          -0.1744811816030730, 0.2745085302719055, 0.3976780188174350,
          0.0318596173974013, -0.0555426616915507, 0.2904965662346584,
          -0.2527194533943667, -0.0793882303257629, 0.8968129799609237,
          -0.3281228876175762, -0.3381852564511750, -0.6043013269771726,
          -0.0113948518849196, -0.2337148103733051, 0.3856808733247407,
          -0.2769060741580809, -0.2843038110360489, 0.1972044320764798,
          0.7844899781695884, 0.2548284491987585, 0.0938616204052071,
          0.1011773695896719, 0.2298394701284774, 0.9594375487420673,
          -0.0567739400544667, 0.1362163630149031, 0.5826050309504506,
          0.2170110563373668, 0.2044857942501505, 0.3509818362448357,
          -0.5244213962663592, 0.4151559000986273, 0.4904467204723293,
          -0.1506744870364624, -0.3329169285887026, 0.3299032297090743,
          -0.2958218721135955, 0.2822630498214182, 0.1149408745938855,
          -0.5538483664506550, -0.1202940679480051, -0.7524477544029973 ]
      - [ -0.2982778076753020, -0.2705314959362149, -0.0274222129024565,
          0.8488785299099981, 0.0170159170379935, -0.2107339390911162,
          0.5609713402576745, 0.6336125328563155, -0.2120206944070757,
          0.2861084315352141, 0.0678567804411054, -0.5563727205432950,
          0.1024693493358791, 0.0620033507235348, -0.0114391176630557,
          -1.1315334856249391 ]
</code></pre>
<p>Ist bei mir nur alles ein recht ungesunder c/c++ misch geworden, weil ich demnächst meine Bachelorarbeit abgeben muss, und ärger mit meinem alten Funktionsapproximator habe. Hab dann die letzten Tage das auf opencv umgestellt und habe heute den ganzen Tag danach gesucht, warum sich das nciht laden lässt. Und die opencv Doku...naja, hilfreich finde ich die nicht <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
<p>//Edit: Lauffähig ist gut. Compilierbar ist es <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2090081</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2090081</guid><dc:creator><![CDATA[Schlangenmensch]]></dc:creator><pubDate>Thu, 07 Jul 2011 20:21:01 GMT</pubDate></item><item><title><![CDATA[Reply to probleme beim laden euronaler netze mit opencv on Thu, 07 Jul 2011 20:38:25 GMT]]></title><description><![CDATA[<blockquote>
<p>OpenCV-2.3.0/modules/core/src/persistence.cpp:685: error: (-2) The node is neither a map nor an empty collection in function cvGetFileNodeByName</p>
</blockquote>
<p><img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
<p>Hast du jetzt noch ein Minibeispiel, mit dem du sone unlesbare YML erzeugen kannst?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2090094</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2090094</guid><dc:creator><![CDATA[Dobi]]></dc:creator><pubDate>Thu, 07 Jul 2011 20:38:25 GMT</pubDate></item><item><title><![CDATA[Reply to probleme beim laden euronaler netze mit opencv on Thu, 07 Jul 2011 21:08:58 GMT]]></title><description><![CDATA[<p>Kann es sein, dass du die .yml datei anders genannt hast als im Code? Den Fehler hatte ich nämlich mal, als ich ausversehen auf eine nicht vorhandene Datei zugreifen wollte <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /> Aber mit dem oben geposteten Code bekomme ich den Fehler:</p>
<pre><code>OpenCV Error: Bad argument (The array of layer neuron counters must be an integer vector) in CvANN_MLP::create, file ml/mlann_mlp.cpp, line 226
terminate called after throwing an instance of 'cv::Exception'
</code></pre>
<p>//Edit:<br />
Ich glaube du hast mich mit deiner Fehlermeldung aber trotzdem auf den Richtigen Weg gebracht. Mit einfach einem leeren FileNode kann er natürlich nix anfangen.</p>
<p>Betreffend meines Compilierbaren minimal Beispiels von oben und der dazu gehörigen yml datei hier das lauffähige beispiel:</p>
<pre><code>#include &lt;opencv/cxcore.h&gt;
#include &lt;opencv/cv.h&gt;
#include &lt;opencv/ml.h&gt;

int main(int argc, char** argv)
{
	CvANN_MLP xfuncApprox=CvANN_MLP();
	CvFileStorage* fs=cvOpenFileStorage(&quot;netX0.yml&quot;, 0, CV_STORAGE_READ );
	CvFileNode* annInNode1;
	annInNode1=cvGetFileNodeByName(fs,NULL, &quot;test&quot;);

	xfuncApprox.read(fs, annInNode1);
}
</code></pre>
<p>Vielen Dank für die schnelle Hilfe <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2090105</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2090105</guid><dc:creator><![CDATA[Schlangenmensch]]></dc:creator><pubDate>Thu, 07 Jul 2011 21:08:58 GMT</pubDate></item><item><title><![CDATA[Reply to probleme beim laden euronaler netze mit opencv on Thu, 07 Jul 2011 21:04:08 GMT]]></title><description><![CDATA[<p>Hast Recht. Habs korrigiert. Jetzt bekomm ich auch den &quot;OpenCV Error: Bad argument (The array of layer neuron counters must be an integer vector) in CvANN_MLP::create&quot;.</p>
<p>Wie bist du denn nun an die YML drangekommen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2090115</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2090115</guid><dc:creator><![CDATA[Dobi]]></dc:creator><pubDate>Thu, 07 Jul 2011 21:04:08 GMT</pubDate></item><item><title><![CDATA[Reply to probleme beim laden euronaler netze mit opencv on Thu, 07 Jul 2011 21:09:23 GMT]]></title><description><![CDATA[<p>Ich habe für meine BA Arbeit ein Lernverfahren implementiert. Nennt sich nfq-learning. Das weiter auszubreiten würde den rahmen sprengen glaube ich.</p>
<p>Auf jeden Fall lernt man da eine Wertefuktion Mithilfe eines neuronalen Netzes, was man bei opencv mit approximator.write(filestorage, node) speichern kann. Daher die yml <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
<p>Aber wie oben im edit geschrieben, deine Fehlermeldung hat mich zur Lösung des Problems gebracht <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /> Nochmal danke dafür</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2090117</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2090117</guid><dc:creator><![CDATA[Schlangenmensch]]></dc:creator><pubDate>Thu, 07 Jul 2011 21:09:23 GMT</pubDate></item><item><title><![CDATA[Reply to probleme beim laden euronaler netze mit opencv on Thu, 07 Jul 2011 21:22:00 GMT]]></title><description><![CDATA[<p>Hab mir mal angeguckt, wie das mit dem C-Interface da funktioniert (<a href="http://opencv.itseez.com/modules/core/doc/old_xml_yaml_persistence.html" rel="nofollow">http://opencv.itseez.com/modules/core/doc/old_xml_yaml_persistence.html</a>).</p>
<p>Probiers mal so:</p>
<pre><code class="language-cpp">CvANN_MLP xfuncApprox=CvANN_MLP();
CvFileStorage* fs=cvOpenFileStorage(&quot;Forum20110707NN.yml&quot;, 0, CV_STORAGE_READ );
CvFileNode* annInNode1 = cvGetFileNode( fs, (CvFileNode*)0, cvGetHashedKey(fs, &quot;test&quot;) );
xfuncApprox.read(fs, annInNode1);
</code></pre>
<p>Edit: Oh, da war ich wohl etwas lahm. Gut, dass dus gefunden hast.<br />
Edit²: Oha, ich war ja noch viel lahmer als ich dachte. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
<p>Schönen Abend noch. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2090119</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2090119</guid><dc:creator><![CDATA[Dobi]]></dc:creator><pubDate>Thu, 07 Jul 2011 21:22:00 GMT</pubDate></item><item><title><![CDATA[Reply to probleme beim laden euronaler netze mit opencv on Thu, 07 Jul 2011 21:24:05 GMT]]></title><description><![CDATA[<p>Danke, dir auch einen schönen Abend</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2090122</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2090122</guid><dc:creator><![CDATA[Schlangenmensch]]></dc:creator><pubDate>Thu, 07 Jul 2011 21:24:05 GMT</pubDate></item></channel></rss>