smallcorgi / Faster-RCNN_TF

Faster-RCNN in Tensorflow
MIT License
2.34k stars 1.12k forks source link

How to run this project without GPU #141

Open ghost opened 7 years ago

ghost commented 7 years ago

Hello , How execute this porjet https://github.com/smallcorgi/Faster-RCNN_TF without GPU ?

WLpub commented 7 years ago

Install cpu-version tensorflow, ans when you train, use "cpu 0" as the parameters

tengshaofeng commented 7 years ago

@WLpub ,hi , i installed gpu-version tensorflow, and i want to run code in cpu mode. so i run following code 'CUDA_VISIBLE_DEVICES= python train_net.py --device cpu --device_id 0 --weights /home/tengbq/code/Faster-RCNN_TF/data/pretrain_model/VGG_imagenet.npy --imdb voc_2007_trainval --iters 70000 --cfg /home/tengbq/code/Faster-RCNN_TF/experiments/cfgs/faster_rcnn_end2end.yml --network VGGnet_train ' but it gives me the error: no CUDA-capable device is detected

why? can you help me?

WLpub commented 7 years ago

@tengshaofeng Check the wiki page: ./experiments/scripts/faster_rcnn_end2end.sh $DEVICE $DEVICE_ID VGG16 pascal_voc

And for more details:

  1. CUDA_VISIBLE_DEVICES sets visible gpu when tensorflow run. You should not add it.
  2. $DEVICE is variables to be set.
  3. I never try to run train_net.py without the file --"faster_rcnn_end2end.sh", if you want to run this single file, check the .sh for detials
tengshaofeng commented 7 years ago

@WLpub thanks for your answer. when i run 'python train_net.py --device gpu --device_id 0 --weights /home/tengbq/code/Faster-RCNN_TF/data/pretrain_model/VGG_imagenet.npy --imdb voc_2007_trainval --iters 70000 --cfg /home/tengbq/code/Faster-RCNN_TF/experiments/cfgs/faster_rcnn_end2end.yml --network VGGnet_train' everything is ok when in gpu mode. but wrong in cpu mode.

WLpub commented 7 years ago

@tengshaofeng maybe you can show more details about the bug information. Ps. It's bad idea to train this under cpu model, too slow.

tengshaofeng commented 7 years ago

@WLpub thanks for your answer. I have trained my data in gpu correctly. now it is time to for my demo. I want to use cpu for demo also. but when i set CUDA_VISIBLE_DEVICES= or add code os.environ['CUDA_VISIBLE_DEVICES'] = '-1' (or ' ') to train_net.py it dose not work. they came the same error as follows:
""“” assign pretrain model biases to conv2_2 assign pretrain model weights to conv2_1 assign pretrain model biases to conv2_1 no CUDA-capable device is detected no CUDA-capable device is detected no CUDA-capable device is detected no CUDA-capable device is detected no CUDA-capable device is detected no CUDA-capable device is detected no CUDA-capable device is detected no CUDA-capable device is detected Segmentation fault (core dumped) """

I have locate the error from roi pooling, but i do not know how to fix it. my tensorflow version is tensorflow-gpu(1.1.0)

WLpub commented 7 years ago

@tengshaofeng python train_net.py --device cpu --device_id 0 --weights /home/tengbq/code/Faster-RCNN_TF/data/pretrain_model/VGG_imagenet.npy --imdb voc_2007_trainval --iters 70000 --cfg /home/tengbq/code/Faster-RCNN_TF/experiments/cfgs/faster_rcnn_end2end.yml --network VGGnet_train
CUDA_VISIBLE_DEVICES is set for GPU. You shall not use that.

tengshaofeng commented 7 years ago

@WLpub thanks for your help. but it does not work also. came the same error: no CUDA-capable device is detected.