dotnet / machinelearning

ML.NET is an open source and cross-platform machine learning framework for .NET.
https://dot.net/ml
MIT License
9.02k stars 1.88k forks source link

Can't use GPU #5397

Closed kikipoulet closed 4 years ago

kikipoulet commented 4 years ago

System information

Issue

Source code / logs

Literally this project : https://github.com/dotnet/machinelearning-samples/tree/master/samples/csharp/getting-started/DeepLearning_ImageClassification_Training/ImageClassification.Train

Thanks for your help ! :)

harishsk commented 4 years ago

The version of TF.NET that ML.NET depends on, uses CUDA 10.0 which isn't supported by NVidia anymore. We are in the process of figuring out an upgrade path to Cuda 10.1 but in the meanwhile, please update your GPU drivers after installing CUDA 10.0.

harishsk commented 4 years ago

Also please see additional instructions here: https://github.com/dotnet/machinelearning-modelbuilder/issues/998

kikipoulet commented 4 years ago

Thanks for your reply ! So I followed your link and instructions. To try if my GPU works, I tried to use the "model builder extension" in Visual Studio, and I'm glad to say that it works ! snipping

Then the extension generates some code that I tried to run with the GPU. So I changed the Nuget packages : snipping3

And then I tried to run the generated code (in a simple loop of 100 predictions to make it run longer) but it come back on CPU and doesn't use the GPU anymore snipping2 !

What am I doing wrong ? Thanks for your time !

harishsk commented 4 years ago

Hi @kikipoulet Are both cases from the code generated from the Model Builder wizard? Can you please share the code differences between the case that works and the case that doesn't work?

harishsk commented 4 years ago

Hi @kikipoulet It looks like you may have updated your Scisharp.Tensorflow.Redist-Windows-GPU package as well. Can you please retain the version of that to the original codegen-ed version?

harishsk commented 4 years ago

Hi @kikipoulet Please re-activate the issue if the above doesn't answer your questions.