-
Notifications
You must be signed in to change notification settings - Fork 2.5k
boxes = torch.as_tensor(boxes).reshape(-1, 4) valueError #334
Comments
Hi, About your points: 1 - yes, for now we expect that coco-style datasets have COCO in the name
2 - can you add a print(boxes) just before the line that is raising the error, and set the number of worker threads to 0 to simplify identifying the issue?
|
Thanks - the error was dataset related! |
Cool, I'm closing the issue then, let me know if you find other problems. |
My custom dataset does not have segmentation data - I just want to train a model for the object detection task. The defaults in the config set the mask to False, yet, an error still exists as the Coco dataset expects segmentation data. Should I simply comment out line 51 in coco.py such that the mask is not added to the annotation? File "/data/anaconda/envs/mask/lib/python3.7/site-packages/torch/utils/data/dataset.py", line 81, in getitem |
Yes, if your dataset doesn't contain segmentation, you can just comment / remove maskrcnn-benchmark/maskrcnn_benchmark/data/datasets/coco.py Lines 50 to 52 in d28845e
|
❓ Questions and Help
I am using a custom dataset w/ two classes coco-style with pre-trained detectron (R-50-FCN) weights as per issue #15 . I am running into the following errors (the first one I debugged, although not sure if I did it incorrectly).
Since I transformed my dataset in a coco style, must it be named in such a way that coco is part of the name?
I got the following error: RuntimeError: Dataset not available: head_train. I changed the name of the dataset to "cocohead_train" which fixed the error.
I am running into the following error - stack trace below:
2019-01-11 22:53:47,537 maskrcnn_benchmark.trainer INFO: Start training
Traceback (most recent call last):
File "tools/train_net.py", line 171, in
main()
File "tools/train_net.py", line 164, in main
model = train(cfg, args.local_rank, args.distributed)
File "tools/train_net.py", line 73, in train
arguments,
File "/data/home/nprasad/Documents/github/maskrcnn-benchmark/maskrcnn_benchmark/engine/trainer.py", line 56, in do_train
for iteration, (images, targets, _) in enumerate(data_loader, start_iter):
File "/data/anaconda/envs/mask/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 468, in next
return self._process_next_batch(batch)
File "/data/anaconda/envs/mask/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 489, in _process_next_batch
raise batch.exc_type(batch.exc_msg)
ValueError: Traceback (most recent call last):
File "/data/anaconda/envs/mask/lib/python3.7/site-packages/torch/utils/data/_utils/worker.py", line 99, in _worker_loop
samples = collate_fn([dataset[i] for i in batch_indices])
File "/data/anaconda/envs/mask/lib/python3.7/site-packages/torch/utils/data/_utils/worker.py", line 99, in
samples = collate_fn([dataset[i] for i in batch_indices])
File "/data/anaconda/envs/mask/lib/python3.7/site-packages/torch/utils/data/dataset.py", line 81, in getitem
return self.datasets[dataset_idx][sample_idx]
File "/data/home/nprasad/Documents/github/maskrcnn-benchmark/maskrcnn_benchmark/data/datasets/coco.py", line 42, in getitem
boxes = torch.as_tensor(boxes).reshape(-1, 4) # guard against no boxes
ValueError: too many dimensions 'str'
The text was updated successfully, but these errors were encountered: