Skip to content

DNN: network loading should not initialize inputs #16618

Closed

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;

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    affected: 3.4bugcategory: dnn

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions