meng-tang / rloss

Regularized Losses (rloss) for Weakly-supervised CNN Segmentation
MIT License
207 stars 47 forks source link

ImportError: /home/dancer/anaconda3/envs/ToCo/lib/python3.7/site-packages/bilateralfilter-0.1-py3.7-linux-x86_64.egg/_bilateralfilter.cpython-37m-x86_64-linux-gnu.so: undefined symbol: omp_get_thread_num #31

Open Italy2006 opened 1 year ago

Italy2006 commented 1 year ago

when i try "from bilateralfilter import bilateralfilter, bilateralfilter_batch": (i have append.the path of lib.linux-x86_64-3.7, but it seems not work)

ImportError: /home/dancer/anaconda3/envs/ToCo/lib/python3.7/site-packages/bilateralfilter-0.1-py3.7-linux-x86_64.egg/_bilateralfilter.cpython-37m-x86_64-linux-gnu.so: undefined symbol: omp_get_thread_num

ababba12 commented 1 year ago

hi did you solve this problem? i met the same error

shifan-Z commented 7 months ago

I met the same error, too.

hahahehe-coder commented 7 months ago

You can comment out all the places where omp appears. For example, in bilateralfilter.cpp:

void bilateralfilter_batch(float * images, int len_images, float * ins, int len_ins, float * outs, int len_outs,
                              int N, int K, int H, int W, float sigmargb, float sigmaxy){

    //const int maxNumThreads = omp_get_max_threads();
    //printf("Maximum number of threads for this machine: %i\n", maxNumThreads);
    //omp_set_num_threads(std::min(maxNumThreads,N));

    // #pragma omp parallel for
    for(int n=0;n<N;n++){
        bilateralfilter(images+n*3*H*W, 3*H*W, ins+n*K*H*W, K*H*W, outs+n*K*H*W, K*H*W,
                              H, W, sigmargb, sigmaxy);
    }
    //printf("parallel for\n");
}