question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

cuda function crop_and_resize: different signatures for cpu and gpu versions

See original GitHub issue

Hi Paul,

I was trying to get the code to run on cpu only for developing and testing on my local PC before training on a machine equipped with GPU(s).

Unfortunately, there is an issue with the following lines:

https://github.com/pfjaeger/medicaldetectiontoolkit/blob/695277d581128e210893fd0be5068868f21c9dfc/cuda_functions/roi_align_3D/roi_align/crop_and_resize.py#L21-L28

When called, the cpu-only function _backend.crop_and_resize_forward returns an error “crop_and_resize_forward expected 7 arguments, got 8”.

This function is defined in the file ._crop_and_resize.so which is a compiled library so we don’t access to the code. Would you have access to the definition/signature of this function and be able to help resolve this issue ?

Thanks !

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
ThomasLecatcommented, Jan 30, 2019

Submitted PR for this above-mentioned issue with PyTorch 0.4.1: https://github.com/pfjaeger/medicaldetectiontoolkit/pull/16

0reactions
Abbsalehicommented, May 12, 2022

Hi Paul,

I was trying to get the code to run on cpu only for developing and testing on my local PC before training on a machine equipped with GPU(s).

Unfortunately, there is an issue with the following lines:

https://github.com/pfjaeger/medicaldetectiontoolkit/blob/695277d581128e210893fd0be5068868f21c9dfc/cuda_functions/roi_align_3D/roi_align/crop_and_resize.py#L21-L28

When called, the cpu-only function _backend.crop_and_resize_forward returns an error “crop_and_resize_forward expected 7 arguments, got 8”.

This function is defined in the file ._crop_and_resize.so which is a compiled library so we don’t access to the code. Would you have access to the definition/signature of this function and be able to help resolve this issue ?

Thanks !

Hi @ThomasLecat thanks for sharing the problem! I have the same problem, could you find a way to fix it? I am trying to run this below code: python 3.6.10 pytorch= 0.4.0

>>> import _crop_and_resize as _backend 
Read more comments on GitHub >

github_iconTop Results From Across the Web

CUDA C++ Programming Guide - NVIDIA Documentation Center
CUDA C++ extends C++ by allowing the programmer to define C++ functions, called kernels, that, when called, are executed N times in parallel...
Read more >
CUDA GPU Compilation Model - MolSSI Education
Let us now start breaking the code into separate source files by copying the C function signatures and pasting them into an empty...
Read more >
Allocate memory and transfer data — CUDA training materials ...
Let us first go through the functions we are going to need. In CUDA, the developer controls the data flow between host (CPU)...
Read more >
multiple type signatures of Numba cuda.jit - Stack Overflow
The first parameter of cuda.jit needs to be either a signature or a function regarding the documentation. The same is true for the...
Read more >
Extending JAX with custom C++ and CUDA code
The custom call on the GPU isn't terribly different from the CPU version above, but the syntax is somewhat different and there's a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found