TernausNetV2 icon indicating copy to clipboard operation
TernausNetV2 copied to clipboard

Hi, can you make it runnable on cpu-only?

Open antran89 opened this issue 6 years ago • 7 comments

Hi,

I have a simple request to make the code runnable in cpu-only machine. It is more testing the Python notebook.

Thank you.

antran89 avatar Oct 25 '18 06:10 antran89

Not sure if it's possible - might need to find equivalents for the in place abn functions that currently rely on CUDA...I'm interested in finding out the answer to this question too.

billcai avatar Oct 30 '18 17:10 billcai

Hey did you get any solution to this problem?

s-shikharcse avatar Jan 15 '19 18:01 s-shikharcse

I run it on GPU :-)

antran89 avatar Jan 23 '19 13:01 antran89

I have a working CPU version - you need to change all the ifs in module/src/inplace_abn.cpp that seem to only enable the cuda versions. The CPU versions are already implemented but not used - you just need to activate them.

billcai avatar Jan 23 '19 21:01 billcai

@billcai what do you mean by the ifs and is it just in the module/src/inplace_abn.cpp file that this is the case?

NickMcCarthy101 avatar Feb 14 '19 16:02 NickMcCarthy101

Removed this if else statement and just leave the cpu version for all the functions in inplace_abn.cpp

For example, from:

if (x.is_cuda()) { return mean_var_cuda(x); } else { return mean_var_cpu(x); }

To:

return mean_var_cpu(x):

billcai avatar Feb 20 '19 17:02 billcai

Thanks a lot @billcai . Your input helped me after days of struggle on the same. One more important thing I had to do was comment out or delete the "inplace_abn_cuda.cu" in the functions .py script in the modules. Ultimately, then the TernausNetV2 was imported.

shukla-19 avatar Sep 13 '20 07:09 shukla-19