Comments (12)
有没有文字描述呀,我看不了这个图
from faster-rcnn-pytorch.
TypeError: expected seqence object with len>=0 or a single integer
from faster-rcnn-pytorch.
TypeError: expected seqence object with len>=0 or a single integer
同样这个问题
from faster-rcnn-pytorch.
我赌五毛版本问题
from faster-rcnn-pytorch.
you win
from faster-rcnn-pytorch.
no I lose
from faster-rcnn-pytorch.
you win
我遇到同样的问题,请问您怎么解决的,我把torch升级到1.2.0还是不行
from faster-rcnn-pytorch.
you win
我遇到同样的问题,请问您怎么解决的,我把torch升级到1.2.0还是不行
open-mmlab/mmdetection#2842
在frcnn.py中
def detect_image(self, image):
with torch.no_grad():
# 添加以下两行
if isinstance(self.model, torch.nn.DataParallel):
self.model.device_ids = [0]
from faster-rcnn-pytorch.
啊这,是什么东西
from faster-rcnn-pytorch.
在rpn.forward里面,roi返回之前先转到cpu上了,从tensor变成了ndarray,所以dataparallel处理不了了,参考https://discuss.pytorch.org/t/nn-dataparallel-typeerror-expected-sequence-object-with-len-0-or-a-single-integer/97082/23
Yes. Sorry, in this line I put tensor to cpu before gather.
return torch.unsqueeze(loss, 0), predicted_interaction.cpu().detach().view(-1, 1), correct_interaction.cpu().detach().view(-1, 1)
from faster-rcnn-pytorch.
啥意思啊,我为什么没听懂…要是哪段代码有问题,我还得改呢,我这里运行没报错,我不知道是啥问题
from faster-rcnn-pytorch.
Line 118 in ef53d38
faster-rcnn-pytorch/nets/frcnn.py
Line 66 in ef53d38
def forward(self, x, scale=1.):
img_size = x.shape[2:]
h = self.extractor(x)
rpn_locs, rpn_scores, rois, roi_indices, anchor = \
self.rpn.forward(h, img_size, scale)
# print(np.shape(h))
# print(np.shape(rois))
# print(roi_indices)
roi_cls_locs, roi_scores = self.head.forward(h, rois, roi_indices)
return roi_cls_locs, roi_scores, rois, roi_indices
最后的四个返回值,后两个是ndarray的,不是tensor,按论坛里的说法,Dataparallel多卡分配计算完要合并结果,ndarray合并不了,你在rpn里面把roi放到CPU上了,所以这样。
faster-rcnn-pytorch/nets/rpn.py
Line 118 in ef53d38
for i in range(n):
roi = self.proposal_layer(
rpn_locs[i].cpu().data.numpy(),
rpn_fg_scores[i].cpu().data.numpy(),
anchor, img_size,
scale=scale)
batch_index = i * np.ones((len(roi),), dtype=np.int32)
rois.append(roi)
roi_indices.append(batch_index)
我怀疑是版本问题,因为你代码里推理的时候把环境变量设置成了1张卡,可能你的版本没问题,别人的版本Dataparallel还是按照多卡的机制gather的,就失败了
其实推理阶段直接把Dataparallel删了就行
from faster-rcnn-pytorch.
Related Issues (20)
- loss不收敛 HOT 3
- 请问预训练是在什么数据集上进行训练的权重? HOT 1
- IOU计算式具体在哪? HOT 3
- rol pooling换rol alignment
- loss一直上升
- train.py报错。FileNotFoundError: [Errno 2] No such file or directory: 'F:\\my' HOT 2
- 老师你好,训练正常,运行predict.py报错Error(s) in loading state_dict for FasterRCNN,求解 HOT 2
- 有大佬有将文件传到google drive上吗?百度网盘太慢了 HOT 1
- 增加标签训练自己的模型,数据量最少要求多少?
- Object Detection Failure in FRCNN HOT 1
- 在更换Backbone后是否需要冻结BN层 HOT 4
- train.py文件 HOT 1
- num_train、num_val为0
- 请问roi_cls=nan, roi_loc=nan还有total_loss=nan是为什么呢
- 图片的识别
- ROI_LOC损失在0.6一直降不下来
- 只训练了两个epoch的map就到了87.19%???
- 训练样本的划分
- 您好,我发现voc_weights_resnet.pth的权重载入不了网络,请问这是什么原因?
- 未检测到任何目标。 HOT 4
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.