0

I'm working on a virtual machine on a remote server and I want to train a neural network on it but I don't have GPUs to use in this VM. is it possible to train the net on this VM using CPU only? and if that the case, does it work with a large dataset or that will be a problem?

M.M ninja
  • 27
  • 1
  • 3
  • This is very dependent on the model, the framework, the VM, the GPU and CPU your using for references, etc. Yes, it should be straightforward to train on CPU, simply by specifying that choice as the back end when you configure your model. You'd have to consult your model/framework/VM documentation for how to do this; it's hardly an ISO standard. – Prune Feb 27 '19 at 22:53
  • I found the question interesting: I'm new to ML, actually supporting students using it, and I came across a question where NN would be used for mobile devices (it's a study and not mine, thus no further explanation will be provided). I know mobile devices have GPU, BTW. I was thus, just out of pure curiosity, wondering if using CPU was an option at all. – runlevel0 Nov 13 '19 at 08:28

1 Answers1

3

I have used Tensorflow for training a deep neural network. I have used it with GPU and CPU only. The rest of my response is in context of Tensorflow.

Please be aware that Convolution Neural Nets are generally more resource hungry than standard regular feed forward neural networks because CNNs deal with much higher dimensional data. If you are not working deep CNNs then you may be all right to use CPU to and restrict to smaller datasets.

In my scenario, initially I was training with CPU only and then moved on to GPU mode because of speed improvements.

Example of speed

I was able to train the entire MNIST with when using GPU in under 15 minutes. Training on CPU was much slower but you can still learn by cutting down the on the size of the training data set.

Tensorflow with GPU

https://www.tensorflow.org/install/gpu You will need to go through all the installation steps. This involves not only installing Tensorflow but also CUDA libraries.

What is CUDA?

CUDA is the specification developed by NVIDIA for programming with GPU. They provide their native libraries which talk to the underlying hardware. https://docs.nvidia.com/cuda/

How to use TensorFlow GPU?

Sau001
  • 1,451
  • 1
  • 18
  • 25
  • I know that GPUs are much faster than CPU for training a neural net, but if i can't use GPU in my VM what should I do? – M.M ninja Feb 27 '19 at 22:26
  • Much depends on your data. If I were you, then as an example, I would try scaling down the training size of MNIST to 100 samples per digit (instead of approx 1000 per digit). MNIST is just an example. If you are not using CNNs then CPU might not be a problem at all. It all depends. – Sau001 Feb 27 '19 at 22:28
  • What model of GPU you're using? – Infinite Loops Apr 05 '20 at 07:48