Certainly, it is not possible to make two instances of DNNRT.It's probably a resource issue.However, it seems that DNNRT can be used sequentially.I actually tried using the following code:
/*trial of 1st neural network*/
dnnrt.begin("model.nnb");
DNNVariable input (size);
...snip...
dnnrt.inputVariable(input,0);
dnnrt.forward();
DNNVariable output = dnnrt.outputVariable(0);
...snip...
dnnrt.end();
/* trial of 2nd neural network*/
dnnrt.begin("model2.nnb");
...snip...
dnnrt.inputVariable(input,0); /*Use input data all over */
dnnrt.forward();
output = dnnrt.outputVariable(0);
...snip...
dnnrt.end();
This one can use less memory effectively, so why don't you try it?
© 2024 OneMinuteCode. All rights reserved.