RuntimeError: sizes must be non-negative
Closed this issue · 4 comments
hi,I have converted Crowdhuman Annotation to a TXT file, and the Annotations format is written as follows:
$image_path/img_1.jpg x1 y1 x2 y2 person
$image_path/img_1.jpg x1 y1 x2 y2 ignore
but , when i run 'python train.py ', i meet a error:
File "Repulsion_Loss/dataloader.py", line 258, in collater
ig_padded = torch.ones((len(igno), max_num_igno, 5)) * -1 # RuntimeError: sizes must be non-negative
RuntimeError: sizes must be non-negative
i have google this error ,but not solved
I don't know what caused it.
my env is :
python3, pytorch 0.4.1
Cunda8,Cudnn7
Nvidia GTX 1080Ti
i find than when the Variable max_num_igno=0
, this program may be show RuntimeError: sizes must be non-negative
; torch.ones() shouldn't pass a tensor which contains zero ,
i have solved it. thanks
@Leechen2014 , Hi, I am working on pedestrian detection as well. I want to ask a question about how to convert the label format to this:
$image_path/img_1.jpg x1 y1 x2 y2 person
$image_path/img_1.jpg x1 y1 x2 y2 ignore
Because the label includes 'pedestrian', 'persons', 'sitting person', and 'ignore'........ Any advice will be appreciated, thanks.
@Leezhen2014 @rainofmine
Hi, I'm working on CrowdHuman too. Does anyone find that repulsion loss can actually improve performance on CrowdHuman dataset?