ShuangXieIrene / ssds.pytorch

Repository for Single Shot MultiBox Detector and its variants, implemented with pytorch, python3.
MIT License
571 stars 166 forks source link

These nets support only GPU mode?? #7

Open VisionZQ opened 6 years ago

foreverYoungGitHub commented 6 years ago

Currently, it checks whether the gpu can be detected, so it should be work for cpu model. But we still do not have time to test it.

foreverYoungGitHub commented 6 years ago

I'll test it in this week and make sure this repo can be work fine for the cpu model.

VisionZQ commented 6 years ago

Thank you very much.

VisionZQ commented 6 years ago

Hi, Some nets can work fine for gpu mode, but others not, such as 'fssd_lite_mobilenetv2_train_voc.yml' . because the code 'x = torch.autograd.Variable(x, volatile=True).cuda()' in model_builder.py if I modify the code for cpu mode , the error 'Fan in and fan out can not be computed for tensor with less than 2 dimensions' in ssds_train.py", line 189, in initialize getattr(self.model, module).apply(self.weights_init) happened。

foreverYoungGitHub commented 6 years ago

Do you mean fssd_lite_mobilenetv2_train_voc.yaml has problem in cpu model rather than gpu model?

Yes, that part is used to infer the featuremap size. Let me try whether it could work fine in cpu model.

foreverYoungGitHub commented 6 years ago

I just commit a update for cpu model in infer. I test it by running sh time_benchmark.sh. This script can test the speed in cpu model and gpu model.

It seems that all the model is ok, I'll keep this issue open. Please let me know if you have any questions.

VisionZQ commented 6 years ago

Thanks a lot for you kindness and efforts.. I do the same work by run 'sh time_benchmark.sh',all is ok. But , the error happened again when I running 'python train --cfg=./experiments/cfgs/fssd_lite_mobilenetv2_train_voc.yml ' . The error reminder 'Fan in and fan out can not be computed for tensor with less than 2 dimensions ' , it seems that error occur in /lib/ssds_train.py ,in initialize getattr(self.model, module).apply(self.weights_init)

foreverYoungGitHub commented 6 years ago

OK, thanks for that, I'll take a look for that in this week.

foreverYoungGitHub commented 6 years ago

It's weird, I do not meet this problem neither in gpu nor cpu model. Could you share you error?

VisionZQ commented 6 years ago

ok..firstly, I don't have COCO datasets, VOC datasets is available for me.. Step1. I run 'python train.py --cfg=./experiments/cfgs/fssd_lite_mobilenetv2_train_voc.yml '
No module named 'lib.utils.pycocotools._mask'

qq20180330-090906 2x
  So, I shield some code in dataset_factory.py
wx20180330-151307 2x

Then ,run 'python train.py --cfg=./experiments/cfgs/fssd_lite_mobilenetv2_train_voc.yml '

wx20180330-151446 2x
 maybe,I should change the mode of initialization weight  ???
isalirezag commented 6 years ago

it just work on"one" GPU also, no cpu, no multi GPU :/

bailvwangzi commented 5 years ago

The occupancy of CPU is full, how to fix it?

isalirezag commented 5 years ago

reduce the batch size

zhangpzh commented 5 years ago

Hello ! Have you ever manged to modify the project codes to support multiple-gpu training and testing ? @isalirezag