Deeplabcut: How to launch GPU support with Jupyter?

Created on 31 Oct 2018  ·  11Comments  ·  Source: DeepLabCut/DeepLabCut

Hi,
I'm on step 6, using Jupyter notebook.
the code I'm running is:
"TF_CUDNN_USE_AUTOTUNE=0
CUDA_VISIBLE_DEVICES=0
%run ../../../train.py"

I have GPU 1- NVIDIA GeForce GT 730 and I installed CUDA, but still the code is running on my CPU.
What am I doing wrong?

Thanks
Sarit

Most helpful comment

OKAY! I found the solution: https://github.com/jupyter/notebook/issues/2836

first install:

conda install -c conda-forge nb_conda_kernels

then type:

source activate <yourCondaname>

then you need to:
export BROWSER=google-chrome

then, jupyter notebook

Once in the notebook, go to "Kernel > Change Kernel > and select Python [conda enc: DLC2]" (or whatever you call your conda environment!"

All 11 comments

We typically run this in the terminal, so I’m not entirely clear on the binding for Jupyter - let me check into it and get back to you!

(Quick thought, in top right corner make sure your in your anaconda environment)

I can't find what you meant. That's my screen:
capture

Can you describe your system, i.e. are you using an Anaconda environment, or how did you install DLC? If so, you need to select the correct kernel to connect to... Click on "Kernel > Change Kernel > then selection conda env: deeplabcut (or whatever you named it)"

Hello, maybe you installed TF, not TF-GPU?
how can I know whether the TF use CPU or GPU, looking at the task manager?
I installed TF-GPU, in the task manager, the GPU memory is fully used.
I noticed that your iteration reached 7k, how long does it spend?

Here is how you can test if your GPU is properly engaged: https://www.tensorflow.org/guide/using_gpu

Roughly, 7k iterations (depends on image size), would take perhaps 6 minutes on a GPU. Here is an example log file with frames 640 x 480 on a NVIDIA GTX 1080Ti with TF 1.2:

2018-08-18 23:38:10 iteration: 1000 loss: 0.0478 lr: 0.005
2018-08-18 23:39:10 iteration: 2000 loss: 0.0289 lr: 0.005
2018-08-18 23:40:10 iteration: 3000 loss: 0.0243 lr: 0.005
2018-08-18 23:41:09 iteration: 4000 loss: 0.0220 lr: 0.005
2018-08-18 23:42:08 iteration: 5000 loss: 0.0221 lr: 0.005
2018-08-18 23:43:07 iteration: 6000 loss: 0.0201 lr: 0.005
2018-08-18 23:44:06 iteration: 7000 loss: 0.0201 lr: 0.005
2018-08-18 23:45:05 iteration: 8000 loss: 0.0205 lr: 0.005
2018-08-18 23:46:04 iteration: 9000 loss: 0.0184 lr: 0.005
2018-08-18 23:47:02 iteration: 10000 loss: 0.0182 lr: 0.005
2018-08-18 23:48:01 iteration: 11000 loss: 0.0254 lr: 0.02
2018-08-18 23:49:00 iteration: 12000 loss: 0.0234 lr: 0.02
2018-08-18 23:49:59 iteration: 13000 loss: 0.0269 lr: 0.02
2018-08-18 23:50:58 iteration: 14000 loss: 0.0225 lr: 0.02
2018-08-18 23:51:57 iteration: 15000 loss: 0.0207 lr: 0.02
2018-08-18 23:52:55 iteration: 16000 loss: 0.0195 lr: 0.02
2018-08-18 23:53:54 iteration: 17000 loss: 0.0200 lr: 0.02
2018-08-18 23:54:53 iteration: 18000 loss: 0.0186 lr: 0.02
2018-08-18 23:55:52 iteration: 19000 loss: 0.0189 lr: 0.02
2018-08-18 23:56:50 iteration: 20000 loss: 0.0182 lr: 0.02
2018-08-18 23:57:49 iteration: 21000 loss: 0.0203 lr: 0.02
etc.

OKAY! I found the solution: https://github.com/jupyter/notebook/issues/2836

first install:

conda install -c conda-forge nb_conda_kernels

then type:

source activate <yourCondaname>

then you need to:
export BROWSER=google-chrome

then, jupyter notebook

Once in the notebook, go to "Kernel > Change Kernel > and select Python [conda enc: DLC2]" (or whatever you call your conda environment!"

I installed anaconda and downloaded the files with git, just followed the guide instructions.

Did my suggestion solve it for you?

no. in the kernel I have only one option- python. the environment of DLC is
not an option
[image: image.png]

‫בתאריך יום ו׳, 2 בנוב׳ 2018 ב-16:49 מאת ‪Mathis Lab‬‏ <‪
[email protected]‬‏>:‬

Did my suggestion solve it for you?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/AlexEMG/DeepLabCut/issues/91#issuecomment-435404664,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AdnrbwGc0vv3Ox-P94o_Ph8-LBuZ9WUpks5urFtsgaJpZM4YEMGC
.

I think you may want to install this: https://stackoverflow.com/questions/47191297/how-to-switch-environment-on-jupyter-notebook-for-new-notebook (in order to be able to switch environments in jupyter)

Hello, i have a Gaming laptop with Intel HD graphics and Nvidia 1050ti 4gb descrete graphic card. When i run the code in jupyter notebook, i can see in task manager only Intel graphics is being used. How do i make sure my code used Nvidia GPU

Was this page helpful?
0 / 5 - 0 ratings