You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Traceback (most recent call last):
File "generate_tsv.py", line 476, in
generate_tsv(args.outfile, image_ids, args)
File "generate_tsv.py", line 459, in generate_tsv
writer.writerow(get_detections_from_im(fasterRCNN, classes, im_file, image_id, args))
File "generate_tsv.py", line 347, in get_detections_from_im
if len(keep_boxes) < MIN_BOXES:
File "anaconda2/envs/py3.6pytorch1.0/lib/python3.6/site-packages/torch/tensor.
py", line 411, in len
raise TypeError("len() of a 0-d tensor")
TypeError: len() of a 0-d tensor
when keep_boxes only have 1 value that is >0,
torch.squeeze(torch.nonzero(keep_boxes)) will generate a tensor with dim() = 0
Code to reproduce: keep_boxes=torch.tensor([0,1,0,0]) len(torch.squeeze(torch.nonzero(keep_boxes)))
The text was updated successfully, but these errors were encountered:
In my case, this error was caused when the model could not detect any object in the image.
I solved this by:
Skipping that "bad" image during feature extraction or changing the confidence threshold for detection.
Traceback (most recent call last):
File "generate_tsv.py", line 476, in
generate_tsv(args.outfile, image_ids, args)
File "generate_tsv.py", line 459, in generate_tsv
writer.writerow(get_detections_from_im(fasterRCNN, classes, im_file, image_id, args))
File "generate_tsv.py", line 347, in get_detections_from_im
if len(keep_boxes) < MIN_BOXES:
File "anaconda2/envs/py3.6pytorch1.0/lib/python3.6/site-packages/torch/tensor.
py", line 411, in len
raise TypeError("len() of a 0-d tensor")
TypeError: len() of a 0-d tensor
when keep_boxes only have 1 value that is >0,
torch.squeeze(torch.nonzero(keep_boxes)) will generate a tensor with dim() = 0
Code to reproduce: keep_boxes=torch.tensor([0,1,0,0]) len(torch.squeeze(torch.nonzero(keep_boxes)))
Traceback (most recent call last):
File "generate_tsv.py", line 476, in
generate_tsv(args.outfile, image_ids, args)
File "generate_tsv.py", line 459, in generate_tsv
writer.writerow(get_detections_from_im(fasterRCNN, classes, im_file, image_id, args))
File "generate_tsv.py", line 347, in get_detections_from_im
if len(keep_boxes) < MIN_BOXES:
File "anaconda2/envs/py3.6pytorch1.0/lib/python3.6/site-packages/torch/tensor.
py", line 411, in len
raise TypeError("len() of a 0-d tensor")
TypeError: len() of a 0-d tensor
when keep_boxes only have 1 value that is >0,
torch.squeeze(torch.nonzero(keep_boxes)) will generate a tensor with dim() = 0
Code to reproduce:
keep_boxes=torch.tensor([0,1,0,0])
len(torch.squeeze(torch.nonzero(keep_boxes)))
The text was updated successfully, but these errors were encountered: