ncnn call to member function ‘create‘ is ambiguous

ncnn call to member function 'create' is ambiguous

static int argmax(const ncnn::Mat& bottom_blob, ncnn::Mat& top_blob, std::vector &prob)
{
    int size = bottom_blob.total();
    const float* ptr = bottom_blob;
    std::vector > vec;
    vec.resize(size);
    for (int i = 0; i < size; i++)
    {
        vec[i] = std::make_pair(ptr[i], i);
    }
    top_blob.create(bottom_blob.c, 1, 1, 4u);
    float* outptr = top_blob;

    for (size_t i = 0; i < bottom_blob.c; i++)
    {
        int size0 = bottom_blob.channel(i).total();
        std::partial_sort(vec.begin()+size0*i, vec.begin() + size0*(i+1), vec.begin() + size0 * (i + 1),
                          std::greater >());
        outptr[i] = vec[size0 * i].second- size0 * i;
        prob.push_back(vec[size0 * i].first);
    }

    return 0;
}

解决方法:ncnn换成以下版本:

ncnn-20211122-android-vulkan

你可能感兴趣的:(c++基础,android开发,c++,javascript,算法)