Mask_RCNN
Mask_RCNN copied to clipboard
How to run on GPU?
Hello. Tell me please, how can I run on the GPU? At the moment I can run on video and pictures, but unfortunately only on the CPU .. I have a GPU1080 with 8GB, how can I run it on a GPU? Please tell me Thanks
did you install tensorflow with GPU? . it should use GPU by default.
pip install tensorflow-gpu
by default if you install tensorflow-gpu it will automatically run using gpu first to check whether you run on gpu run below code it will show details of gpu or cpu that you run.
from tensorflow.python.client import device_lib print(device_lib.list_local_devices())
@Worulz @5730279821-TA I use command pip3 install --upgrade tensorflow-gpu
from tensorflow site
This is where should I prescribe? in the terminal or in the code?
from tensorflow.python.client import device_lib print(device_lib.list_local_devices())
Thanks for your answer
@Worulz @5730279821-TA tensorflow-gpu is installed, but all the same opens on the CPU. Why can this be so?
Now i check in another PC (in this case notebook).. command results:
print(device_lib.list_local_devices()) 2018-04-15 20:45:31.086775: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:898] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2018-04-15 20:45:31.087226: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1344] Found device 0 with properties: name: GeForce GT 740M major: 3 minor: 0 memoryClockRate(GHz): 0.895 pciBusID: 0000:01:00.0 totalMemory: 1.95GiB freeMemory: 1.74GiB 2018-04-15 20:45:31.087255: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1394] Ignoring visible gpu device (device: 0, name: GeForce GT 740M, pci bus id: 0000:01:00.0, compute capability: 3.0) with Cuda compute capability 3.0. The minimum required Cuda capability is 3.5. 2018-04-15 20:45:31.087278: I tensorflow/core/common_runtime/gpu/gpu_device.cc:911] Device interconnect StreamExecutor with strength 1 edge matrix: 2018-04-15 20:45:31.087291: I tensorflow/core/common_runtime/gpu/gpu_device.cc:917] 0 2018-04-15 20:45:31.087306: I tensorflow/core/common_runtime/gpu/gpu_device.cc:930] 0: N [name: "/device:CPU:0" device_type: "CPU" memory_limit: 268435456 locality {
what's the problem???? Please help
@AshleyRoth Did you have the code that limit number of your gpu like " CUDA_VISIBLE_DEVICES=0 " ?
as @5730279821-TA , you can add these lines:
import os
os.environ['CUDA_VISIBLE_DEVICES'] = '0'
@5730279821-TA @fastlater
I used from here visualization_cv.py https://github.com/markjay4k/Mask-RCNN-series/blob/master/visualize_cv.py for working with camera.
He seems to have nothing in the code about the GPU. I want to run the camera to start, unfortunately this is the only example I found. Each time it is launched only on the CPU ... (I need something to import about the GPU? can not understand...
thanks
I guess your problem is TF. Did you tried with a different script? just for testing if your tensorflow is really using your gpu? Something like:
import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
print(sess.run(hello))
As @Worulz said, it should use GPU by default.
@Worulz @fastlater fixed bugs, it was necessary to install version 1.3. Another problem now, when I run video using a script "visualization_cv.py https://github.com/markjay4k/Mask-RCNN-series/blob/master/visualize_cv.py", uses 97% of the entire video memory (8GB in total). How can I fix this? So that much does not use video memory
@AshleyRoth use cython to speedup
@Zumbalamambo could not explain in detail how to do this, please? Thank you
@AshleyRoth you can limit the gpu memory using the code below. Add it to the script which you are invoking. Keeping in mind you must allocate enough for the model used.
import tensorflow as tf
from keras.backend.tensorflow_backend import set_session
config = tf.ConfigProto()
config.gpu_options.per_process_gpu_memory_fraction = 0.3
set_session(tf.Session(config=config))
source: https://github.com/keras-team/keras/issues/1538
Which cudnn and cuda version is required for setting up this repo for training?
@harshil014 I was able to use the latest cuda version that tensorflow supports.
@Worulz Were you able to use CUDA 9? I'm assuming that you're using tensorflow 1.8 or greater?
@Shreeyak yes.
Thank you. I am facing some weird error regarding imgaug. This eliminates one cause. May I ask which python version you are using?
python 3.6. I'm using it in virtualenv
Hello. Anybody decided problems with run on GPU? I try run train_shapes.ipnb with parameters: GPU_COUNT = 1 IMAGES_PER_GPU =1
but training process all the same using only CPU!! How fix it ? Thanks.
Hello. Anybody decided problems with run on GPU? I try run train_shapes.ipnb with parameters:
GPU_COUNT = 1 IMAGES_PER_GPU =1
but training process all the same using only CPU!! How fix it ? Thanks.
I got the same problem, anyone knows how to fix it? Thx
issue:+1, I'm facing same problem. tf: 1.12.2 (with gpu) cuda: 9.0 cudnn: 7.3.1 keras: 2.1.3 GPU: tesla k40m
I have solved the problem by installing tensorflow-gpu==1.6.0 and keras==2.2.0 with Cuda 10.
When I tried tensorflow-gpu==1.9.0, I noticed that the training started but did not continue.
@kaanaykutkabakci i am trying to get mask rcnn training running on my gpu. So just to be sure the configuration you have installed is tensorflow 1.3 and keras 2.0.8 and tensorflow-gpu as 1.9.0 for Cuda 10?
@kaanaykutkabakci i am trying to get mask rcnn training running on my gpu. So just to be sure the configuration you have installed is tensorflow 1.3 and keras 2.0.8 and tensorflow-gpu as 1.9.0 for Cuda 10?
Hello @subbulakshmisubha . I have installed tensorflow-gpu==1.6.0 and keras 2.2.0 with Cuda 10. This configuration is working without any problem.
@kaanaykutkabakci thanks. What about the TensorFlow version? I have installed tensorflow gpu as per what you mentioned but what should be the TensorFlow version?
@kaanaykutkabakci thanks. What about the TensorFlow version? I have installed tensorflow gpu as per what you mentioned but what should be the TensorFlow version?
@subbulakshmisubha hello. I don't want to mislead you, but as far as I know you don't need to install tensorflow after installing tensorflow-gpu.
I've gotten a consistent method to install a fresh environment with conda and training (with GPU) for the balloon sample. I am new to Python (C++ expert). I forget exactly how I got this environment installed initially. Create a new environment by
conda create --name <env-name> --file working-gpu.txt
python3 setup.py install
working-gpu.txt file is attached, I'm on Ubuntu 18.04.
based on the record from @amy-tabb , tensorflow-gpu=1.14.0 + keras=2.2.4 finally work for me. I'm using Ubuntu 16.04.
@harshil014 I was able to use the latest cuda version that tensorflow supports.
could u please explain how u made it work. which versions of tf-gpu, keras for windows
i solved my problem: conda install -c anaconda tensorflow-gpu=1.14.0 (i have mega mess in system) :-)