When I add the option TargetDevice->"GPU" to NetTrain in Mathematica 11.0.0.0 I get the error ‘First argument to NetTrain should be a fully specified net’. Is this broken in 11.0.0.0?
Can you post your full example that you think should be working? Its impossible to debug this without more information.
Hi,
I first tried the following example available on the Wolfram website:
That failed, so I then tried to modify the following example that is also available on the Wolfram website:
It works until you modify the NetTrain command and add TargetDevice->“GPU”. That results in the same error.
GW
Again, can you post the code that is failing for your example?
Also, what is the failure message with your “I first tried the following example available on the Wolfram website” example?
I have attached the second example as a Notebook. It works as designed without TargetDevice->“GPU”, but fails if you specify that option.
GW
The documentation is doing something slightly confusing. It is reassigning to the value “lenet”.
Try the following. Rename “lenet” to “trainedlenet” after it has been trained. You will want to re-run everything from the top after doing this:
lenet = NetChain[{ConvolutionLayer[20, 5], Ramp, PoolingLayer[2, 2],
ConvolutionLayer[50, 5], Ramp, PoolingLayer[2, 2], FlattenLayer[],
500, Ramp, 10, SoftmaxLayer[]},
"Output" -> NetDecoder[{"Class", Range[0, 9]}],
"Input" -> NetEncoder[{"Image", {28, 28}, "Grayscale"}]];
trainedlenet = NetTrain[lenet, trainingData, ValidationSet -> testData,
MaxTrainingRounds -> 3, TargetDevice -> "GPU"]
This way you can be sure to not get them mixed up.
In your picture, some of the code is black and some of the code is blue.
The syntax highlighter highlights things in blue if they are undefined. This means that it thinks “lenet”, “trainingdata” and “testData” are all undefined for some reason.
I’ve attached my notebook. It shows a simple evaluation which leads to a failure (because I don’t have a compatible graphics card). But you can see it runs.
Hi,
Before I hit Shift+Enter to evaluate the NetTrain command my notebook looks like:
After I hit Shift+Enter to evaluate the NetTrain command my notebook looks like:
So the evaluation of the NetTrain command invalidates these objects? Still I do not get the same output as without the TargetDevice->“GPU” option.
GW
There does seem to be problem. It probably only happens with the your graphics card or driver. We haven’t been able yet to reproduce it.
What Operating System are you using? Additionally, do you know what your graphics card is?
We would like to reproduce the problem as closely as possible. If you can, please send an email to support@wolfram.com about this issue. If you can, include a notebook where you have evaluated the command SystemInformation[]. This will tell us more about your computer and its graphics card, helping us to fix this issue.
Ah, this is the problem. We are making use of cuDNN, which requires compute capability >=3.0 (CUDA Deep Neural Network (cuDNN) | NVIDIA Developer).
It is a bug though that we are not catching this properly and displaying a useful message.
Should this code work in Mathematica 11 on a Dell Alienware with Nvidia GPU 660?
data = {1 -> "One", 2 -> "Two", 3 -> "Three", 4 -> "Four"};
Classify[data, {Method -> "NeuralNetwork",
PerformanceGoal -> "Quality", TargetDevice -> "GPU"}]
Here is my info:
In[9]:= CUDAInformation[]
Out[9]= {1 -> {"Name" -> "GeForce GTX 660", "Clock Rate" -> 888500,
"Compute Capabilities" -> 3., "GPU Overlap" -> 1,
"Maximum Block Dimensions" -> {1024, 1024, 64},
"Maximum Grid Dimensions" -> {2147483647, 65535, 65535},
"Maximum Threads Per Block" -> 1024,
"Maximum Shared Memory Per Block" -> 49152,
"Total Constant Memory" -> 65536, "Warp Size" -> 32,
"Maximum Pitch" -> 2147483647,
"Maximum Registers Per Block" -> 65536, "Texture Alignment" -> 512,
"Multiprocessor Count" -> 6, "Core Count" -> 192,
"Execution Timeout" -> 1, "Integrated" -> False,
"Can Map Host Memory" -> True, "Compute Mode" -> "Default",
"Texture1D Width" -> 65536, "Texture2D Width" -> 65536,
"Texture2D Height" -> 65536, "Texture3D Width" -> 4096,
"Texture3D Height" -> 4096, "Texture3D Depth" -> 4096,
"Texture2D Array Width" -> 16384,
"Texture2D Array Height" -> 16384,
"Texture2D Array Slices" -> 2048, "Surface Alignment" -> 512,
"Concurrent Kernels" -> True, "ECC Enabled" -> False,
"TCC Enabled" -> False, "Total Memory" -> 1610612736}}
In[10]:= CUDAResourcesInformation[]
Out[10]= {{"Name" -> "CUDAResources", "Version" -> "10.5.0",
"BuildNumber" -> "", "Qualifier" -> "Win64",
"WolframVersion" -> "10.5+", "SystemID" -> {"Windows-x86-64"},
"Description" -> "{ToolkitVersion -> 7.0, MinimumDriver -> 300.0}",
"Category" -> "", "Creator" -> "", "Publisher" -> "",
"Support" -> "", "Internal" -> False,
"Location" ->
"C:\\Users\\David\\AppData\\Roaming\\Mathematica\\Paclets\\\
Repository\\CUDAResources-Win64-10.5.0", "Context" -> {},
"Enabled" -> True, "Loading" -> Manual,
"Hash" -> "79fa747a52a45bf2d78e2c3516c80061"}}
Here is the error I am getting:
Classify::optx: Unknown option TargetDevice in Classify[{1->One,2->Two,3->Three,4->Four},{Method->NeuralNetwork,PerformanceGoal->Quality,TargetDevice->GPU}].
No, Classify has no support for GPU (as you can see from docs).
When I run the example.nb above, everything works fine. I am assuming my GTX 660 is compatible but TargetDevice is just not a parameter of Classify yet.
This should be added because everything I have built uses Classify or Predict and forcing users like myself to specify the parameters of super complicated NeuralNetworks in order to utilize GPUs is not going to be good for mass adoption.
BTW: It only took about 2 minutes to finish the full training in the example.nb which is amazing!
I have upgraded to a GTX 1050 with compute capability 6.1 and my error is gone. The training results are wrong however. Without TargetDevice->“GPU” the results are OK, but with TargetDevice->“GPU” I am seeing this while training:
and the resulting recognition is also very poor. I am running Mathematica 11.0.1.0 on 64-bit Ubuntu 4.4.0-51-generic, the Nvidia driver version is 875.20 and the CUDA version is 8.0.
How can I troubleshoot this?
GW







