ARM-software / armnn

Arm NN ML Software. The code here is a read-only mirror of https://review.mlplatform.org/admin/repos/ml/armnn
https://developer.arm.com/products/processors/machine-learning/arm-nn
MIT License
1.17k stars 309 forks source link

Test Failed for CaffeAlexNet-Armnn #681

Closed xiaotongnii closed 2 years ago

xiaotongnii commented 2 years ago

system info: armnn 21.02 ubuntu18.04 platform:android aarch:arm corterA76+A55

when CaffeAlexNet-Armnn test for armnn, erro happend.

CaffeAlexNet-Armnn -i 1 -d ../data/ -m ../model -c CpuRef -l ../labels/imagenet_labels.txt --inference-times-file ./out -e 1 -v 1 --fp16-turbo-mode 1 --validation-file-out ./out

armnn : Fatal: Armnn Error: Couldn't find requested output layer '**prob**' in graph model: bvlc_alexnet_1.caffemodel netron show bvlc_alexnet_1.caffemodel that input node :data, output node:fc8,but CaffeAlexNet-Armnn output node prob;

Where can get bvlc_alexnet_1.caffemodel for armnn test or other way to deal with it.

` int main(int argc, char* argv[]) { int retVal = EXIT_FAILURE; try { using DataType = float; using DatabaseType = CaffePreprocessor; using ParserType = armnnCaffeParser::ICaffeParser; using ModelType = InferenceModel<ParserType, DataType>;

    // Coverity fix: ClassifierInferenceTestMain() may throw uncaught exceptions.
    retVal = armnn::test::ClassifierInferenceTestMain<DatabaseType, ParserType>(
                 argc, argv, "bvlc_alexnet_1.caffemodel", true, "data", "prob", { 0 },
                 [](const char* dataDir, const ModelType &) {
                     return DatabaseType(dataDir);
                 });
}
catch (const std::exception& e)
{
    // Coverity fix: BOOST_LOG_TRIVIAL (typically used to report errors) may throw an
    // exception of type std::length_error.
    // Using stderr instead in this context as there is no point in nesting try-catch blocks here.
    std::cerr << "WARNING: CaffeAlexNet-Armnn: An error has occurred when running the "
                 "classifier inference tests: " << e.what() << std::endl;
}
return retVal;

} `

ArmRyan commented 2 years ago

Hi @Shelton-N,

We dropped support for Caffe in 21.05 and as such no longer have information on where the AlexNet model came from. I'm sorry that I can't help more!

Best of luck, Ryan

xiaotongnii commented 2 years ago

image

xiaotongnii commented 2 years ago

@ArmRyan , I know that, but, some app still use as armnn21.02,please give me some advices. I from http://dl.caffe.berkeleyvision.org/bvlc_alexnet.caffemodel to convert bath size = 1 ,bvlc_alexnet_1.caffemodel, I try again: ./CaffeAlexNet-Armnn -d ../data/ -m ../model/ -i 1 -e 1 -c CpuRef -l ../labels/imagenet_labels.txt -v 1

failed erro:

08-02 21:48:39.848 31795 31795 D armnn : Info: ArmNN v22.0.0 08-02 21:48:39.865 31795 31795 D armnn : Info: Initialization time: 16.47 ms 08-02 21:48:39.866 31795 31795 D armnn : Info: Shutdown time: 0.00 ms 08-02 21:48:39.866 31795 31795 D armnn : Fatal: Armnn Error: Data blob at index 0 in layer conv1 has an unexpected size. Expected 34848 elements but got 0 elements. at function GetDataFromBlob [/home/armnn/src/armnnCaffeParser/CaffeParser.cpp:115]

ArmRyan commented 2 years ago

The latest version is v22.05.1, We don't provide support for deprecated features. From what you have sent, It seems like it is not finding the data being provided, I would check that the data file is being passed in correctly and that the file is not empty.

I'm sorry I can't help anymore! Ryan

xiaotongnii commented 2 years ago

OK,thanks