Skip to content

DNN: network loading should not initialize inputs #16618

@alalek

Description

@alalek

Test code:

    // 1. load network
    const string proto = findDataFile("dnn/bvlc_alexnet.prototxt");
    const string model = findDataFile("dnn/bvlc_alexnet.caffemodel", false);
    Net net = readNetFromCaffe(proto, model);

    // 2. mistake: no inputs are specified through .setInput()

    // 3. try inference
    Mat res;
    EXPECT_THROW(
    {
        res = net.forward();  // no inputs after loading => should fail
    }, cv::Exception);
    EXPECT_TRUE(res.empty()) << res.size;

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions