Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test.py ERROR:I trained the net with my own data,got the error below when run test.py #24

Open
DetectionIIT opened this issue Nov 7, 2018 · 2 comments

Comments

@DetectionIIT
Copy link

DetectionIIT commented Nov 7, 2018

(py27) guowei@iitlab-cat:~/gg/DetNet_Pytorch$ CUDA_VISIBLE_DEVICES=1 python test_dota.py exp_name --dataset pascal_voc --net detnet59 --checksession 1 --checkepoch 11 --checkpoint 315 --cuda --load_dir weights --soft_nms

load checkpoint weights-dota/detnet59/pascal_voc/exp_name/fpn_1_11_315.pth
load model successfully!
/home/disk2/gg/DetNet_Pytorch/lib/model/rpn/rpn_fpn.py:79: UserWarning: Implicit dimension choice for softmax has been deprecated. Change the call to include dim=X as an argument.
rpn_cls_prob_reshape = F.softmax(rpn_cls_score_reshape)
/home/disk2/gg/DetNet_Pytorch/lib/model/fpn/fpn.py:259: UserWarning: Implicit dimension choice for softmax has been deprecated. Change the call to include dim=X as an argument.
cls_prob = F.softmax(cls_score)
Traceback (most recent call last):
File "test_aiia.py", line 232, in
data = data_iter.next()
File "/home/disk2/anaconda3/envs/py27/lib/python2.7/site-packages/torch/utils/data/dataloader.py", line 210, in next
return self._process_next_batch(batch)
File "/home/disk2/anaconda3/envs/py27/lib/python2.7/site-packages/torch/utils/data/dataloader.py", line 230, in _process_next_batch
raise batch.exc_type(batch.exc_msg)
ValueError: Traceback (most recent call last):
File "/home/disk2/anaconda3/envs/py27/lib/python2.7/site-packages/torch/utils/data/dataloader.py", line 42, in _worker_loop
samples = collate_fn([dataset[i] for i in batch_indices])
File "/home/disk2/gg/DetNet_Pytorch/lib/roi_data_layer/roibatchLoader.py", line 67, in getitem
blobs = get_minibatch(minibatch_db, self._num_classes)
File "/home/disk2/gg/DetNet_Pytorch/lib/roi_data_layer/minibatch.py", line 30, in get_minibatch
im_blob, im_scales = _get_image_blob(roidb, random_scale_inds)
File "/home/disk2/gg/DetNet_Pytorch/lib/roi_data_layer/minibatch.py", line 79, in _get_image_blob
cfg.TRAIN.MAX_SIZE)
File "/home/disk2/gg/DetNet_Pytorch/lib/model/utils/blob.py", line 39, in prep_im_for_blob
im -= pixel_means
ValueError: operands could not be broadcast together with shapes (3593,6335,4) (1,1,3) (3593,6335,4)

I have no idea of this error,please help me. Is the data error??

@JeasonUESTC
Copy link

Hi,Did you find any error when you trained ,and I find it I always collapse when I'm training. As follow:
Traceback (most recent call last):
File "trainval_net.py", line 362, in
roi_labels = FPN(im_data, im_info, gt_boxes, num_boxes)
File "/root/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 325, in call
result = self.forward(*input, **kwargs)
File "/DetNet_Pytorch/lib/model/fpn/fpn.py", line 209, in forward
gt_assign_pos = gt_assign[pos_id]
IndexError: Indexing a Tensor with a torch.cuda.LongTensor triggers index_select semantics, and thus we expect a vector, but the indexing Tensor passed has 0 dimensions.

@Lydaidai
Copy link

嗨,你训练时发现任何错误,我发现它在训练时总是崩溃。如下所示:
Traceback(最近一次调用最后一次):
文件“trainval_net.py”,第362行,在
roi_labels = FPN(im_data,im_info,gt_boxes,num_boxes)
文件“/root/anaconda3/lib/python3.6/site-packages /torch/nn/modules/module.py“,第325行,在调用
结果= self.forward(* input,** kwargs)
文件”/DetNet_Pytorch/lib/model/fpn/fpn.py“,第209行,in forward
gt_assign_pos = gt_assign [pos_id]
IndexError:使用torch.cuda.LongTensor索引Tensor会触发index_select语义,因此我们期望一个向量,但传递的索引Tensor有0个维度。

Hello, I have encountered the same problem. Have you solved it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants