-
Notifications
You must be signed in to change notification settings - Fork 293
Darknet- and converted ELL-model give different inference results #138
Comments
I noticed that in your ELL file, the first FullyConnectedLayer is correctly followed by a Bias, but is missing the ReLUActivationLayer. I imported both your configs, and the resulting ELL files all have an activation layer between the last two FullyConenctedLayers i.e. the end of the network should look like:
Can you confirm whether importing using the bits in master now produces a model which includes the correct activation layer? |
Same thing happens to me. After importing my Darknet trained network to ELL it gives very bad results compared to the tests I have performed using just Darknet. What could be the reason? |
Can you share your Darknet config and weights files so we can try to import and reproduce the problem? |
Hello, mnist_lenet.cfg.txt I tried two things yesterday:
Thanks for helping, |
I have trained a cnn using Darknet to dintinguish between 3 classes of robots. I need ELL to implant this network in a raspberry pi who actuallly is on board of another robot. So the thing is that when I test the network as it gets out of darknet, it reaches like 90-95% accuracy. I import the network as indicated in the tutorial and everything seems to be fine, but when I try it the percentages I obtain are almost always the same and are wrong and they are not similar to the results obtained when testing using darknet whatsoever. robotsGardenCressDoubleFC.cfg.zip robotsGardenCressDoubleFC.weights.zip Thank you so much for this amazing tool and your dedication. |
Thanks for the model .cfg and .weights files! I was able to reproduce the problem and found what was causing the errors:
|
Thank you very much for your response. I've tried replacing darknet_to_ell.py but it isn't working. In fact, in this case, the predictions are always the same. No matter how different the test images are. |
Thanks a lot. With the workaround py-file I get the ReLu-layer inserted in the ELL-file and the inference output values are different but still do not match the darknet values. So I will wait as well for the complete fix. P.S.: I got rid of the 'MapCompilerOptions'-error mentioned above by pulling a clean version of the current ELL-repository and compiling it again. |
Hi, For more details, I've tested this network using Darknet and it works as expected so I don't know whether I'm making any kind of mistake when using the darknet_import.py tool. Because I don't know what else it could be. Thanks a lot in advance. Cheers. |
Thanks for the bug report, I have filed this internally to make sure we take a look and fix it. |
Hello,
I am trying to convert a small darknet-based cnn (originating from https://github.com/ashitani/darknet_mnist, working on the mnist dataset) to ELL.
I trained the darknet-model and afterwards followed the tutorial on this page for converting darknet models to ELL. After training and before converting I removed the cost-layer and the dropout-layer from the original darknet-model before converting, as they are used for training only as far as I have understood. (I did this because at first the darknet cost layer gave me a warning message during conversion - "sse not known" or something like that - and the dropout layer also seemed not to be converted into the ELL model).
After figuring out that I need to feed the mnist images not in the color channel range [0..1] (as in the darknet-framework) but [0..255] (as the ELL model automatically includes a scaling layer), I run the model on the same mnist images in the darknet- and ELL-framework. I checked that both models get the same array / vector (2352 float values, 28x28x3 values) of values in the same order (beside the scaling mentioned above).
The problem is, that I get very different prediction results from the models. E.g the darknet model gives me on one image a 93% for the most probably class (which is the right one), whereas the converted ELL-model gives only 17% for that class - it is still the most probable, but I would expect to get prediction results which are much closer to each other, as the model structure and weights should be (nearly) the same?
result of darknet-model:
data/mnist/images/v_01862_c4.png: Predicted in 0.054000 seconds.
c4: 0.933212
c9: 0.046099
c8: 0.008588
c5: 0.003347
c7: 0.002880
result of model converted to ELL:
D:\Crest\Libs\darknet_mnist\data\mnist\images\v_01862_c4.png
(17%) 4 (16%) 1 (12%) 9 (11%) 5 (11%) 3
Mean prediction time: 7ms/frame
Right now I have no idea what can cause this huge difference and where to look further.
I have attached the original darknet-cfg file (mnist_lenet.cfg) as well as the one used for converting and doing the inference in darknet (mnist_lenet.nodropout_nocost.cfg) and the converted ELL-file (I have removed the weights from that file, otherwise it would have 40 MB).
mnist_lenet.cfg.txt
mnist_lenet.nodropout_nocost.cfg.txt
mnist_lenet_woweights.ell.txt
Thank you very much,
Sven
The text was updated successfully, but these errors were encountered: