Dear SNPE developers,
I've found such a problem when running my dlc file that contains udl layers using snpe-net-run-udl. see below for the error log:
------------------------------------------------------------------------------
UdlMyCustomScale::setup() of name conv1_1/negative
UdlMyCustomScale::setup() input size dim: 3686400, output: 3686400
UdlMyCustomScale::setup() got blob size 81
UdlMyCustomScale::setup() invalid weights
UdlMyCustomScale::close()
UdlMyCustomScale::close()
UdlMyCustomScale::close()
UdlMyCustomScale::close()
...
error_code=1103; error_message=UDL setup failed. Failed to set up successfully for layer conv1_1/negative; error_component=User-defined Layer; line_no=179; thread_id=140663334301568
-----------------------------------------------------------------------------------
For further information, the dlc file was created successfully using a prototxt file and a caffemodel. The prototxt file contains MyCustomScale layers that were made according to the tutorial. The dlc file can also be viewed using 'snpe-dlc-ino -i mydlc.dlc'.
snpe-net-run-udl was also created without flagging out any errors, and it can run the example of mnist.
In your opinion, what would be the cause for the error I encountered and what could be the solution to correct this issue?
Thanks very much!
Best regards,
Dear SNPE team,
Would you please have a look at this post and point me to the right direction? Thanks very much
Best regards,
Don't want to be a pest, but find no other way to get this message noticed by SNPE team rather than reply to my own post...
Dear SNPE team, just wonder if you've read this post or not? Your reply will be very much appreciated!
If you read the source code
You'll get error when inszdim != weights_dim[0]
Apparently your blob size 81 is way smaller than the input size 3686400
which lead to the error.
Either you need to fix the input dim or change the weight (specify by the blob)
-Tingfan
Umbo Computer Vision Inc
Hi TIngfan,
Thanks so much for your reply. This is indeed very helpful!
Would you please share more thoughts on this topic as I am still baffled by other related cases in using UDL.
If I run the UDL example in SNPE tutorial , i.e., adding MyCustomScale layer to MNIST model, no error messges popped out. In this case, for the MyCustomScale layer, the blob_size is 2017 and the input dims are 500 (see below). Apparently 2017 is not equal to 500, does this mean the blob_size can be equal or smaller than out dims?
---------------------------------------------------------------
---------------------------------------------------------------
Am I correct in treating blob_size as a parameter predefined in caffemodel file whereas input and output dims are parameters specified in prototxt file? When creating the dlc file, how would the caffemodel and weights be matched? Thanks again for your time on this topic.
Best regards,
Hi TIngfan,
Thanks so much for your reply. This is indeed very helpful!
Would you please share more thoughts on this topic as I am still baffled by other related cases in using UDL.
If I run the UDL example in SNPE tutorial , i.e., adding MyCustomScale layer to MNIST model, no error messges popped out. In this case, for the MyCustomScale layer, the blob_size is 2017 and the input dims are 500 (see below). Apparently 2017 is not equal to 500, does this mean the blob_size can be greater or equal than in/out dims?
---------------------------------------------------------------
---------------------------------------------------------------
Am I correct in treating blob_size as a parameter predefined in caffemodel file whereas input and output dims are parameters specified in prototxt file? When creating the dlc file, how would the caffemodel and weights be matched? Thanks again for your time on this topic.
Best regards,
You may want to read this function in udlCustomLayer.cpp to understand the relationship between blobs and weight size.
Thanks, Tingfan.
We actually realized that it was the size of the weights in this layers doesn't match the size of inputs.
In caffe, we only need to assign weights for channels, and under the same channel, all the elments (size of height by width) share the same weight, which was not supported by SNPE custom scale layer by default. We got it right by tweaking the source code.
Cheers