NudeNet icon indicating copy to clipboard operation
NudeNet copied to clipboard

How do you switch to onnxruntime-gpu?

Open rmills opened this issue 3 years ago • 2 comments

With onnxruntime being used in V2, I can't seem to force it to run on a GPU by default despite it being shown. There is another support ticket that says to uninstall onnxruntime and install onnxruntime-gpu however its unclear what that means. Uninstalling with PIP breaks nudenet regardless of the onnxruntime-gpu being installed. It will throw the exception "module 'onnxruntime' has no attribute 'InferenceSession'".

What are the steps to get onnxruntime-gpu running?

rmills avatar Sep 27 '21 20:09 rmills

The docs really need to be updated. Going from v1 to v2 has a ton of steps and details there are just not listed anywhere. Getting V2 to work is convoluted and some of the documentation/notes are misleading. To get the GPU version working took hours. There was a comment about TF versions not mattering, this is not true. You can't use TF 2 and I only found that out after I uninstall everything and installed the latest, and that means you can only use python 3.7 and that creates other issues. The latest version of onnx did not work for me I had to go back to 1.8 and then sort out the correct cuda and cuDNN version to use just to find out the onnx files does not work thou I had no idea that was the case so I spent an hour thinking I had the wrong cuda/cuDNN installed until I saw a different support ticket. You have to fix it with another script in that solution and that one requires a different specific version of cuda that you have to go find.

At a minimum it would be helpful to know upfront what libs are required and their specific versions that were tested. Should also update the "detector_v2_default_checkpoint.onnx" that's hosted.

rmills avatar Sep 27 '21 22:09 rmills

The docs really need to be updated. Getting V2 to work is convoluted and some of the documentation/notes are misleading. To get the GPU version working took hours.

At a minimum it would be helpful to know upfront what libs are required and their specific versions that were tested. Should also update the "detector_v2_default_checkpoint.onnx" that's hosted.

Feel free to submit a pull request.

bedapudi6788 avatar Sep 28 '21 14:09 bedapudi6788

Hi, v3 is released now and with lot less requirements. I am closing this issue for now. If gpu usage is needed, you can install nudenet first and then install onnxruntime-gpu after uninstalled onnxruntime

bedapudi6788 avatar Sep 11 '23 10:09 bedapudi6788