Comments (5)
FWIW, there is also a subtle bug in the cuda backwards code for roi pooling that manifests itself only when batch size is > 1:
This line
should end with== (c * height + h) * width + w
instead of == index
, or else gradients will be propagated only into the first element of the batch. Discovered this issue while using roi pooling layer for another project.from faster_rcnn_pytorch.
It supports batch_size > 1. You can comment the if statement in roi_pooling_cuda.c and rebuild it.
from faster_rcnn_pytorch.
@longcw @JeffCHEN2017
does this project support batch_size larger than 1?
from faster_rcnn_pytorch.
Yes, it supports as long as you comment the codes in row_pooling_cuda.c. Please read the code for details. And I have been using it for a while and so far so good.
from faster_rcnn_pytorch.
@JeffCHEN2017 , @longcw, can you please elaborate how you managed to train with multiple batch size? As you guys suggested, I re-ran roi_pooling_cuda.c by commenting out the relevant lines. Then, I changed IMS_PER_BATCH: 4 in experiments/cfgs/faster_rcnn_end2end.yml
. When I start to train I got the following:
File "train.py", line 115, in <module>
blobs = data_layer.forward()
File "/home/sam/Projects/detection/frcnn.pytorch/faster_rcnn/roi_data_layer/layer.py", line 74, in forward
blobs = self._get_next_minibatch()
File "/home/sam/Projects/detection/frcnn.pytorch/faster_rcnn/roi_data_layer/layer.py", line 70, in _get_next_minibatch
return get_minibatch(minibatch_db, self._num_classes)
File "/home/sam/Projects/detection/frcnn.pytorch/faster_rcnn/roi_data_layer/minibatch.py", line 39, in get_minibatch
assert len(im_scales) == 1, "Single batch only"
AssertionError: Single batch only
Then, I commented out relevant assert lines, and finally got another error:
File "train.py", line 123, in <module>
net(im_data, im_info, gt_boxes, gt_ishard, dontcare_areas)
File "/home/sam/.virtualenvs/cv/lib/python2.7/site-packages/torch/nn/modules/module.py", line 224, in __call__
result = self.forward(*input, **kwargs)
File "/home/sam/Projects/detection/frcnn.pytorch/faster_rcnn/faster_rcnn.py", line 215, in forward
features, rois = self.rpn(im_data, im_info, gt_boxes, gt_ishard, dontcare_areas)
File "/home/sam/.virtualenvs/cv/lib/python2.7/site-packages/torch/nn/modules/module.py", line 224, in __call__
result = self.forward(*input, **kwargs)
File "/home/sam/Projects/detection/frcnn.pytorch/faster_rcnn/faster_rcnn.py", line 71, in forward
cfg_key, self._feat_stride, self.anchor_scales)
File "/home/sam/Projects/detection/frcnn.pytorch/faster_rcnn/faster_rcnn.py", line 122, in proposal_layer
x = proposal_layer_py(rpn_cls_prob_reshape, rpn_bbox_pred, im_info, cfg_key, _feat_stride, anchor_scales)
File "/home/sam/Projects/detection/frcnn.pytorch/faster_rcnn/rpn_msr/proposal_layer.py", line 131, in proposal_layer
proposals = bbox_transform_inv(anchors, bbox_deltas)
File "/home/sam/Projects/detection/frcnn.pytorch/faster_rcnn/fast_rcnn/bbox_transform.py", line 59, in bbox_transform_inv
pred_ctr_x = dx * widths[:, np.newaxis] + ctr_x[:, np.newaxis]
ValueError: operands could not be broadcast together with shapes (74592,1) (18648,1)
Seems like it can't load boxes? Have you experiences anything likes this? If so, how did you manage to solve it?
from faster_rcnn_pytorch.
Related Issues (20)
- For getting more accuracy in faster rcnn , which parameters i have to tune (tuning parameters)
- IndexError: list index out of range
- It is question about cpu only
- ImportError: torch.utils.ffi is deprecated. Please use cpp extensions instead what pytorch version we need HOT 1
- It is prediction time problem?
- Is this a Fast-RCNN structure rather than Faster-RCNN?? HOT 1
- potential bug in __init__.py
- Building module pycocotools._mask failed: ["CompileError: command 'gcc' failed with exit status 1\n"]
- out of memory if don`t fix VGG16 param HOT 1
- BaiduYun is canceled ! unable to download the trained model
- RuntimeError: Trying to backward through the graph a second time, but the buffers have already been freed. Specify retain_graph=True when calling backward the first time
- sh make.sh problem in Window10.. HOT 1
- No module named 'blob'
- Modification of the VGG16 network
- AttributeError: 'module' object has no attribute 'roi_pooling_forward_cuda'
- TypeError: dist must be a Distribution instance HOT 5
- No module named 'resource'
- ImportError: libcudart.so.10.0: cannot open shared object file. HOT 2
- ./make.sh 出现ModuleNotFoundError: No module named 'torch' HOT 1
- __cudaRegisterFatBinaryEnd HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from faster_rcnn_pytorch.