Comments (13)
Hi @liviolima80 the Caffe parser doesn't support the 'Data' layer: the supported layers are listed in CaffeSupport.md in the armnnCaffeParser source directory. However I am aware that we have a working test using Lenet. I'll find out which version of the model we're using and post back here.
from armnn.
Hi @MatthewARM ,
it should be great to have a documentation (and an example model) on how to configure the Caffe training in order to have a model that can be loaded with armnnCaffeParser.
If you download the AlexNet reference model on Caffe repository from
https://github.com/BVLC/caffe/tree/master/models/bvlc_alexnet
and you run ExecuteNetwork on the model with first layer named "data" and last layer named "prob" you have the following error:
Armnn Error: Couldn't find requested output layer 'prob' in graph
even if the "prob" layer is the last layer defined in the model as you can check in the deploy.prototxt
If I pass the prototxt file instead I have the following error:
Armnn Error: Expected data blob at index 0 in layer conv1 not found
Could you please verify these problems?
from armnn.
Hi @MatthewARM , any news?
from armnn.
Hi @liviolima80, I've been looking into the issues you reported and I will have some news for you today
from armnn.
Hi @liviolima80 ,
Apologies for the delay, I had to clarify a few things before I could provide a clear answer. I was able to reproduce the errors you reported.
1 - Passing a caffe-text input:
The error is because the .protoxt file doesn't have the weights included. In Tensorflow you can merge the network weights with the model definition in the .protoxt but Caffe doesn't really support this, it was an oversight on our side and we will be clarifying the expected behaviour on our next release. The caffe-binary input for Lenet is working, see below.
1.1 Armnn Error: Unsupported layer type 'Data'
It's case sensitive. Change the input layer to '-i data'
2 - Alexnet caffe-binary input not working.
I was able to reproduce this issue as well. We have an Alexnet test that runs fine outside the ExecuteNetwork app, so we must be doing something wrong in the app. I'll open a bug to investigate this further and we'll let you know of the outcome.
from armnn.
Hi again @liviolima80,
It appears that my 1.1 answer above is incorrect. That error is caused when you use a caffe .prototxt with the old syntax (which Armnn doesn't support). That can be easily fixed with something like:
import caffe
net = caffe.Net('old.prototxt', '.caffemodel', caffe.TEST)
net.save('new.caffemodel')
Let us know if that works
from armnn.
Hi @TelmoARM ,
first of all thanks for your reply, i'll try the python fix you suggest. The problem is that the loading of a caffe model in python does not work in windows, i have to do in linux
In the meantime, can you provide me the pyton code you use to build the model for train in caffe in order to create a model that works with armnn? I usually use the following
n = caffe.NetSpec()
n.data, n.label = L.Data(batch_size=batch_size, backend=P.Data.LMDB, source=lmdb, transform_param=dict(scale=1./255), ntop=2)
n.conv1 = L.Convolution(n.data, kernel_size=3, num_output=32, weight_filler=dict(type='xavier'))
n.relu1 = L.ReLU(n.conv1, in_place=True)
n.conv2 = L.Convolution(n.relu1, kernel_size=3, num_output=32, weight_filler=dict(type='xavier'))
n.relu2 = L.ReLU(n.conv2, in_place=True)
n.pool1 = L.Pooling(n.relu2, kernel_size=2, stride=2, pool=P.Pooling.MAX)
......
Thanks
from armnn.
Hi @TelmoARM ,
with your fix now the model works! Now I have another problem that the network output is wrong but probably I load the data to input tensor in wrong way. I need to investigate about this
Thank you
from armnn.
Hi @liviolima80 ,
Good to hear the fix worked.
I've also found the problem with Alexnet. The Alexnet deploy.prototxt has got the batch size set to 10 but Armnn uses batch size in the model and there's no way to override it, so we need to generate a new model with the batch size set to 1. To do this:
Open the Alexnet deploy.prototxt and change 'input_param { shape: { dim: 10 dim: 3 dim: 227 dim: 227 } }' to 'input_param { shape: { dim: 1 dim: 3 dim: 227 dim: 227 } }' and save it as Alexnet1.prototxt.
Run the following python script
import caffe
net = caffe.Net('deploy.prototxt', '/home/bvlc_alexnet.caffemodel', caffe.TEST)
new_net = caffe.Net('Alexnet1.prototxt', '/home/bvlc_alexnet.caffemodel', caffe.TEST)
new_net.save('bvlc_batchsize_1.caffemodel')
The new bvlc_batchsize_1.caffemodel runs through Armnn.
from armnn.
Closing this ticket as I believe both issues have been solved.
from armnn.
How to solve the problem ?Armnn Error: Couldn't find requested output layer 'prob' in graph. I used the trained caffemodel directly. Should I convert it OR use both develop.prototxt and trained caffemodel?@liviolima80
from armnn.
Hi Garry,
This ticket has been resolved. To help us diagnose the problem could you tell us if you are following any of the instructions in this thread?
Are you using the Execute Network app? If so, how are you using it?
The easiest way to address your issue would be to open a new ticket and provide the configuration, set-up and relevant information.
Thanks,
Telmo
from armnn.
@TelmoARM I have solved my problem. I have wrote a blog (of course in Chinese), and I put my codes in github.
I have put my code on Ambarella platform, and running successfully.
I think your document are too few, you should tell us we must convert the trained caffemodel to the inference caffemodel, and something important we need to attend to about cross compile. (I also wrote a blog about how to configure the develop environment about armnn sdk, compute library, protobuf and so on.)
from armnn.
Related Issues (20)
- opencv failed to call opencl HOT 1
- ScatterND not support HOT 3
- Building ARM NN via Docker approach with specific GLIBC , GLIBCXX versions ... HOT 3
- Gather(ND) dim error HOT 1
- Link error on older Android devices HOT 8
- BUG: using delegate with transformer | AttributeError: 'NoneType' object has no attribute 'c_void_p' HOT 22
- About the configuration setting of externalMemoryManagementEnabled HOT 1
- The mali gpu computation capability is only used no more than 15% when inference resnet50 with ArmNN HOT 1
- onnx deployment fail HOT 7
- Another error on another model and by now it's two out of three :( HOT 22
- Unsupported Operation "Transpose" in armNN::OnnxParser while loading the onnx model file (in the goal to run inference) HOT 8
- Build Issues -Werrors on armbian 24 HOT 1
- nvalid attempt to construct ConstTensor from non-constant TensorInfo HOT 1
- Profiler service warnings seen in ArmNN v24.02 HOT 4
- Does ExecuteNetwork support "GpuAcc" runtime ? HOT 13
- Running YOLOv5 ONNX model with onnx parser of armnn fails with unsupported operation HOT 2
- Crash when support ArmNN AIDL backend based on a shim over the NNAPI Support Library
- Crash when support ArmNN AIDL backend based on a shim over the NNAPI Support Library HOT 2
- Unitests failed HOT 3
- understanding the onnx parser HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from armnn.