Azure / ImageSimilarityUsingCntk

Deep Neural Network based Image Similarity ranking on Azure using CNTK

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

refine DNN - using only cpu

chandu-v opened this issue · comments

I've bought a data science virtual machine for linux(ubuntu) on azure. I cloned the code base and I ran the 2_refineDNN.py file. It stated that it's running on cpu. I know it takes very long time to run on cpu. Can anyone please help me to start it working on gpu.

The version of vm I purchased on azure doesn't have a gpu and that is why it is not doesn't start gpu. Please check the list of vm's that support gpu

For future reference : If you want to run anything on GPU

CNTK has built-in functions to check for availability of GPU and set it as the default device for the computations which can be found in device.py which calls cntk_py.py and inturn _cntk_py.pyd

Working
If there is an unlocked (not assigned to anything else) GPU device lock it to this task
Else use CPU

Debug
One can always list all the available devices by using either,

  1. import cntk ; cntk.DeviceDescriptor.all_devices(); #child module
    2 . import _cntk_py as c ; c.DeviceDescriptor_all_devices(); #parent module

If one is not satisfied by the default device used by the script or wants to choose an alternate device, it can be externally coerced by passing the desired device id to the try_set_default_device function

Tip
When working with multiple resources it is often a good practice to list the devices and their IDs so as to assign them as per task priorities