Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mxnet2ncnn concat layer bug #266

Closed
zhaolili opened this issue Feb 9, 2018 · 1 comment
Closed

mxnet2ncnn concat layer bug #266

zhaolili opened this issue Feb 9, 2018 · 1 comment

Comments

@zhaolili
Copy link

zhaolili commented Feb 9, 2018

mxnet2ncnn.cpp中,原始mxnet json文件没有dim attr, 转换后的ncnn param文件 axis会被设为-1, concat layer 的forward流程跳出。

//mxnet2ncnn.cpp
else if (n.op == "Concat")
{
   int dim = n.attr("dim");        //dim = 0
   fprintf(pp, " 0=%d", dim-1);
}
//concat.cpp
int Concat::load_param(const ParamDict& pd)
{
    axis = pd.get(0, 0);   //axis = -1
    return 0;
}
//concat.cpp
int Concat::forward(const std::vector<Mat>& bottom_blobs, std::vector<Mat>& top_blobs) const
{
    int dims = bottom_blobs[0].dims;
    size_t elemsize = bottom_blobs[0].elemsize;

    if (dims == 1) // axis == 0
    {
        
    }

    if (dims == 2 && axis == 0)
    {
        
    }

    if (dims == 2 && axis == 1)
    {
       
    }

    if (dims == 3 && axis == 0)
    {

    }

    if (dims == 3 && axis == 1)
    {
        
    }

    if (dims == 3 && axis == 2)
    {
        
    }

    return 0;
}
@nihui
Copy link
Member

nihui commented Feb 9, 2018

f4f5a96

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants