Mask_RCNN icon indicating copy to clipboard operation
Mask_RCNN copied to clipboard

GPU not in use

Open ehsanpi opened this issue 5 years ago • 8 comments

The code runs only on CPU. I guess the error arises due to the this message: " Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2". Can you kindly explain why?

BTW, I followed all instructions and requirements both in Conda and without. I successfully ran the cuda sample with GPU full usage.

OS: Windows 10 GPU: NVIDIA 1080 Cuda: 9.0 cuDNN: 7.4.2 Python: 3.6

ehsanpi avatar Jan 19 '19 03:01 ehsanpi

" Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2".

That error message is unrelated I think. It just means that, in order to get maximum speed when running in CPU, you must build Tensorflow yourself with AVX2 enabled. They are disabled by default so that the distributed binaries work in all machines (and some do not support AVX2)

As to not using GPU, I can think of two reasons for that: In the config.py file, is GPU_COUNT set to 1? If it is set to 0 it will not use it Do you have tensorflow-gpu installed? If you only have tensorflow it will run on CPU

4sfaloth avatar Jan 23 '19 17:01 4sfaloth

Thanks 4sfaloth. It was great. I could install it properly.

ehsanpi avatar Jan 25 '19 05:01 ehsanpi

In the config.py file, is GPU_COUNT set to 1? If it is set to 0 it will not use it

But here it says 1 for CPU https://github.com/matterport/Mask_RCNN/blob/master/mrcnn/config.py#L27

Correct me if I am missing something.

mymultiverse avatar Mar 17 '19 11:03 mymultiverse

The code runs only on CPU. I guess the error arises due to the this message: " Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2". Can you kindly explain why?

BTW, I followed all instructions and requirements both in Conda and without. I successfully ran the cuda sample with GPU full usage.

OS: Windows 10 GPU: NVIDIA 1080 Cuda: 9.0 cuDNN: 7.4.2 Python: 3.6

The code runs only on CPU. I guess the error arises due to the this message: " Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2". Can you kindly explain why?

BTW, I followed all instructions and requirements both in Conda and without. I successfully ran the cuda sample with GPU full usage.

OS: Windows 10 GPU: NVIDIA 1080 Cuda: 9.0 cuDNN: 7.4.2 Python: 3.6

When you run pip3 install -r requirements.txt, a cpu version of tensorflow is automatically installed. Uninstall it and reinstall a gpu version

qchenclaire avatar Mar 30 '19 02:03 qchenclaire

Can you provide some suggestions on how to install the required GPU version correctly? I am having trouble install it. I am trying to install it inside a gpu tensorflow docker.

liuxin00738 avatar May 28 '19 03:05 liuxin00738

Can you provide some suggestions on how to install the required GPU version correctly? I am having trouble install it. I am trying to install it inside a gpu tensorflow docker.

pip uninstall tensorflow && pip install tensorflow-gpu

ouguozhen avatar Jul 03 '19 09:07 ouguozhen

" Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2".

That error message is unrelated I think. It just means that, in order to get maximum speed when running in CPU, you must build Tensorflow yourself with AVX2 enabled. They are disabled by default so that the distributed binaries work in all machines (and some do not support AVX2)

As to not using GPU, I can think of two reasons for that: In the config.py file, is GPU_COUNT set to 1? If it is set to 0 it will not use it Do you have tensorflow-gpu installed? If you only have tensorflow it will run on CPU

I hev the same issue. But I already install tenorflow-gpu and set GPU_COUNT = 2. it still run on CPU, not on GPU. Could you help me?

ngocson1804 avatar Sep 13 '19 09:09 ngocson1804

Good moorning to you please, I have some problem. when I run Mask RCNN for crater dectection, I got this error:

[ 0.7614669 0.5845174 1.1143883 1.2913378 ]]] 2024-03-05 06:50:19.778224: W tensorflow/core/framework/op_kernel.cc:1753] OP_REQUIRES failed at strided_slice_op.cc:108 : Invalid argument: slice index 1 of dimension 0 out of bounds. 2024-03-05 06:50:19.783188: W tensorflow/core/framework/op_kernel.cc:1753] OP_REQUIRES failed at strided_slice_op.cc:108 : Invalid argument: slice index 1 of dimension 0 out of bounds. 2024-03-05 06:50:19.783738: W tensorflow/core/framework/cpu_allocator_impl.cc:81] Allocation of 67108864 exceeds 10% of free system memory. 2024-03-05 06:50:19.911323: W tensorflow/core/framework/cpu_allocator_impl.cc:81] Allocation of 67108864 exceeds 10% of free system memory. 2024-03-05 06:50:23.824540: W tensorflow/core/framework/op_kernel.cc:1753] OP_REQUIRES failed at strided_slice_op.cc:108 : Invalid argument: slice index 1 of dimension 0 out of bounds. 2024-03-05 06:50:23.830073: W tensorflow/core/framework/op_kernel.cc:1753] OP_REQUIRES failed at strided_slice_op.cc:108 : Invalid argument: slice index 1 of dimension 0 out of bounds. 2024-03-05 06:50:23.834308: W tensorflow/core/framework/op_kernel.cc:1753] OP_REQUIRES failed at strided_slice_op.cc:108 : Invalid argument: slice index 1 of dimension 0 out of bounds. Traceback (most recent call last): File "crater.py", line 365, in video_path=args.video) File "crater.py", line 230, in detect_and_color_splash r = model.detect([image], verbose=1)[0] File "C:\Users\juteno\projet\11\Mask_RCNN-master\samples\crater\mrcnn\model.py", line 2627, in detect detections, _, _, mrcnn_mask, _, _, _ = self.keras_model.predict([molded_images, image_metas, anchors], verbose=0) File "C:\Users\juteno\anaconda3\envs\rcnn11\lib\site-packages\keras\engine\training.py", line 1462, in predict callbacks=callbacks) File "C:\Users\juteno\anaconda3\envs\rcnn11\lib\site-packages\keras\engine\training_arrays.py", line 324, in predict_loop batch_outs = f(ins_batch) File "C:\Users\juteno\anaconda3\envs\rcnn11\lib\site-packages\tensorflow\python\keras\backend.py", line 3792, in call outputs = self._graph_fn(*converted_inputs) File "C:\Users\juteno\anaconda3\envs\rcnn11\lib\site-packages\tensorflow\python\eager\function.py", line 1605, in call return self._call_impl(args, kwargs) File "C:\Users\juteno\anaconda3\envs\rcnn11\lib\site-packages\tensorflow\python\eager\function.py", line 1645, in _call_impl return self._call_flat(args, self.captured_inputs, cancellation_manager) File "C:\Users\juteno\anaconda3\envs\rcnn11\lib\site-packages\tensorflow\python\eager\function.py", line 1746, in _call_flat ctx, args, cancellation_manager=cancellation_manager)) File "C:\Users\juteno\anaconda3\envs\rcnn11\lib\site-packages\tensorflow\python\eager\function.py", line 598, in call ctx=ctx) File "C:\Users\juteno\anaconda3\envs\rcnn11\lib\site-packages\tensorflow\python\eager\execute.py", line 60, in quick_execute inputs, attrs, num_outputs) tensorflow.python.framework.errors_impl.InvalidArgumentError: slice index 1 of dimension 0 out of bounds. [[node ROI/strided_slice_12 (defined at C:\Users\juteno\anaconda3\envs\rcnn11\lib\site-packages\keras\backend\tensorflow_backend.py:3009) ]] [Op:__inference_keras_scratch_graph_14630]

Function call stack: keras_scratch_graph

(rcnn11) C:\Users\juteno\projet\11\Mask_RCNN-master\samples\crater>

could someone help me please ?

JuniorTakam avatar Mar 05 '24 05:03 JuniorTakam