Mask_rcnn: How can I run Mask_RCNN/samples/demo.ipynb in GPU?

Created on 18 Jul 2018  路  16Comments  路  Source: matterport/Mask_RCNN

Hi,
When I ran the demo.ipynb notebook no GPU memory is utilized. What changes do I need to make to run it in GPU?

Thanks

Most helpful comment

You can try this:

  1. Run $ pip freeze | grep tensorflow to check if you have tensorflow-gpu python package is installed.
    You should see the following terminal output:
tensorboard==1.9.0
tensorflow-gpu==1.9.0
  1. If not, please install it via pip.
  2. $ pip uninstall tensorflow
  3. $ pip install tensorflow-gpu==1.9.0

All 16 comments

Have you installed CUDA or any other graphical platform?

yes. I have a working Titan GPU environment. Usually, we will transfer the model to GPU by model.to(device) or model.cuda(). But here I didn't find anything like that.

You do not need model.to(device), just open the jupyter notebook in your gpu virtualenv.

I am doing that only. But during running, no GPU memory is utilized (checking via nvidia-smi).

Okay lets start from the beginning.

  1. Windows or other
  2. Anaconda or not?
  3. Installed CUDA and cuDNN?
  4. Do you have any games or such installed that might be using your nvidia card?

Linux,
Anaconda,
cuDNN,
no

  1. Did you set the path for both CUDA and cuDNN?

I can run other deeplearning programs without any error. So I think the environment is fine.

Did you install the gpu version of tensorflow?

Also check in the Nvidia control panel for the icon of gpu activity

Ok

You can try this:

  1. Run $ pip freeze | grep tensorflow to check if you have tensorflow-gpu python package is installed.
    You should see the following terminal output:
tensorboard==1.9.0
tensorflow-gpu==1.9.0
  1. If not, please install it via pip.
  2. $ pip uninstall tensorflow
  3. $ pip install tensorflow-gpu==1.9.0

@cardboardcode Sorry for the late reply. My tensorflow was not gpu version. Now I can run in GPU. I have another doubt, how can I specify the GPU device, currently it is running on all GPUs available.
Thanks

I have same problem,i use nvidia-smi to check the gpu ,but i found the gpu doesn't show work,while the program is running ,so how can i check whether i use gpu.
1.Linux2.not Anacoda 3.installed cuda &cudnn 4.yes,there is a program shows "/usr/bin/python" using gpu0 and"/home/sky/anaconda/envs/fastai/bin/python"using gpu 1,which occupy 1g ,and both 2 cards
have 16G for GPU memory. Besides tensorfow==1.40 tensorflow-gpu==1.3.0 tensorflow-tensorboard==0.1.8, I also set path for CUDA in my bashrc.

I have solved the problem, I uninstall the tensorflow==1.40,just keep tensorflow-gpu ,and it works.

if you don't have a GPU, you can run the notebook on Google Collab.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

techjjun picture techjjun  路  4Comments

msson picture msson  路  4Comments

wjdhuster2018 picture wjdhuster2018  路  3Comments

LifeBeyondExpectations picture LifeBeyondExpectations  路  4Comments

PaulChongPeng picture PaulChongPeng  路  4Comments