Code Monkey home page Code Monkey logo

Comments (7)

Lam1360 avatar Lam1360 commented on May 23, 2024 6

Hey, I solve this problem!
The problem lies in lib/build.sh. What I do is just to add '-gencode arch=compute_70,code=sm_70' (according to my GPU device RTX2070) to the CUDA_ARCH and recompile the NMS extension. Now everything works well!
Hope this help someone and sorry for my poor English.

from pytorch-retinanet.

mahaling avatar mahaling commented on May 23, 2024 1

Here's a bug I found in compiling nms.. hope it is useful to someone.
The build.sh file is saying "$CUDA_ARCH" as a parameter to nvcc command which was not set inside my docker environment.
The actual nvcc command goes like the one in the link below.
https://github.com/multimodallearning/pytorch-mask-rcnn

I replaced $CUDA_ARCH with --arch=sm_52 (I have a titanx).

I was getting a "no gpu_nms" module found error before and it was gone after compiling nms properly.

Hope this helps someone.

from pytorch-retinanet.

yhenon avatar yhenon commented on May 23, 2024

Hi,
I'm looking into this issue. Could you please indicate:

  • Were you able to compile the NMS extension without any errors?
  • Is this running in a jupyer notebook ?

Thanks.

from pytorch-retinanet.

CPFLAME avatar CPFLAME commented on May 23, 2024

Thanks for your reply.

  1. I think I compile the NMS extension without any errors:

root@9a42af0f41ef:/pytorch-retinanet/lib# sh build.sh
Compiling nms kernels by nvcc...
Including CUDA code.
/pytorch-retinanet/lib/nms
generating /tmp/tmpKGuPdx/_nms.c
setting the current directory to '/tmp/tmpKGuPdx'
running build_ext
building '_nms' extension
creating pytorch-retinanet
creating pytorch-retinanet/lib
creating pytorch-retinanet/lib/nms
creating pytorch-retinanet/lib/nms/src
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTI
FY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DWITH_CUDA -I/usr/local/lib/python2.7/dist-packages/torch/utils/ffi/../../lib/include -I/usr/local/lib/python2.7/dist-packages/torch/utils/ffi/../../lib/include/TH -I/usr/local/lib/python2.7/dist-packages/torch/utils/ffi/../../lib/include/THC -I/usr/local/cuda/include -I/usr/include/python2.7 -c _nms.c -o ./_nms.o -std=c99 -std=c99x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTI
FY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DWITH_CUDA -I/usr/local/lib/python2.7/dist-packages/torch/utils/ffi/../../lib/include -I/usr/local/lib/python2.7/dist-packages/torch/utils/ffi/../../lib/include/TH -I/usr/local/lib/python2.7/dist-packages/torch/utils/ffi/../../lib/include/THC -I/usr/local/cuda/include -I/usr/include/python2.7 -c /pytorch-retinanet/lib/nms/src/nms.c -o ./pytorch-retinanet/lib/nms/src/nms.o -std=c99 -std=c99x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTI
FY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DWITH_CUDA -I/usr/local/lib/python2.7/dist-packages/torch/utils/ffi/../../lib/include -I/usr/local/lib/python2.7/dist-packages/torch/utils/ffi/../../lib/include/TH -I/usr/local/lib/python2.7/dist-packages/torch/utils/ffi/../../lib/include/THC -I/usr/local/cuda/include -I/usr/include/python2.7 -c /pytorch-retinanet/lib/nms/src/nms_cuda.c -o ./pytorch-retinanet/lib/nms/src/nms_cuda.o -std=c99 -std=c99/pytorch-retinanet/lib/nms/src/nms_cuda.c: In function ‘gpu_nms’:
/pytorch-retinanet/lib/nms/src/nms_cuda.c:29:35: warning: initialization from incompatible pointer type [-Wincompatible-p
ointer-types] unsigned long long* mask_flat = THCudaLongTensor_data(state, mask);
^
/pytorch-retinanet/lib/nms/src/nms_cuda.c:37:40: warning: initialization from incompatible pointer type [-Wincompatible-p
ointer-types] unsigned long long * mask_cpu_flat = THLongTensor_data(mask_cpu);
^
/pytorch-retinanet/lib/nms/src/nms_cuda.c:40:39: warning: initialization from incompatible pointer type [-Wincompatible-p
ointer-types] unsigned long long* remv_cpu_flat = THLongTensor_data(remv_cpu);
^
/pytorch-retinanet/lib/nms/src/nms_cuda.c:23:7: warning: unused variable ‘boxes_dim’ [-Wunused-variable]
int boxes_dim = THCudaTensor_size(state, boxes, 1);
^
x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-
aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wl,-Bsymbolic-functions -Wl,-z,relro -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security ./_nms.o ./pytorch-retinanet/lib/nms/src/nms.o ./pytorch-retinanet/lib/nms/src/nms_cuda.o /pytorch-retinanet/lib/nms/src/cuda/nms_kernel.cu.o -o ./_nms.so

  1. I run it in docker(on a Linux machine) instread of jupyter notebook.
    Thanks.

from pytorch-retinanet.

qq184861643 avatar qq184861643 commented on May 23, 2024

@yhenon Hi have you figured out the problem of nms yet?I think I confront the same problem but I run it in a jupyter notebook. Thx


Well, I've read the codes about NMS and I think there is a problem as using only one pass of nms which treated all the detected objects in the same category. Shouldn't it using nms several times over each categories?
However, I'm not quite sure that this problem related to @CPFLAME yours

from pytorch-retinanet.

foralliance avatar foralliance commented on May 23, 2024

@qq184861643 HI
Agree with u.

In my experiment, although visualize works fine, there was no problem. But i think we should do nms once for each category when using NMS.

@yhenon
hope your help!!
many many thanks!!

from pytorch-retinanet.

Lam1360 avatar Lam1360 commented on May 23, 2024

I come across the same problem! The NMS extension has been compiled without any errors. I don't know how to solve it. Can anyone help me?

from pytorch-retinanet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.