Check failed: data_ MemoryDataLayer needs to be initialized by calling Reset

33 views
Skip to first unread message

杜明軒

unread,
Dec 3, 2016, 9:48:51 AM12/3/16
to Caffe Users
I am using caffe c++ api, but there are problems when forwarding using memory 
data layer.
Here is the sample code.
    Net<float>* net2_(new caffe::Net<float>(DEEP_DRIVE_NET, caffe::TEST));
    std::vector<cv::Mat> frames;
    frames.push_back(image);
    std::vector<int> labels(frames.size());
    MemoryDataLayer<float> *m_layer = (MemoryDataLayer<float> *)net2_->layers()[0].get();  
    m_layer->AddMatVector(frames, labels);

    net2_->Forward();
The caffe throws the exception: 
Check failed: data_ MemoryDataLayer needs to be initialized by calling Reset
I am not sure if this is a bug or not?
Thank you.

Reply all
Reply to author
Forward
0 new messages