-
Notifications
You must be signed in to change notification settings - Fork 111
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
dimension specified as 0 but tensor has no dimensions #8
Comments
What is your version of torchvision, this problem may be because it is different from what I used. Please check torchvision==0.2.1. |
@zhangxiaosong18 I checked the version of torchvision and torchvision==0.2.1. I installed all the python libraries recording to INSTALL.md you offered. |
Are you using other datasets? This may because my code still loading the mask, although it is not used, please delete line 51-53 in maskrcnn_benchmark/data/datasets/coco.py, as:
|
I have updated it to the master branch. |
The problem has been fixed when I deleted line 51-53 in coco.py. Thank you! |
the issue is as follows:
Traceback (most recent call last):
File "/usr/share/pycharm/helpers/pydev/pydevd.py", line 1758, in
main()
File "/usr/share/pycharm/helpers/pydev/pydevd.py", line 1752, in main
globals = debugger.run(setup['file'], None, None, is_module)
File "/usr/share/pycharm/helpers/pydev/pydevd.py", line 1147, in run
pydev_imports.execfile(file, globals, locals) # execute the script
File "/usr/share/pycharm/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "/media/zy/Documents/FreeAnchor/tools/train_net.py", line 171, in
main()
File "/media/zy/Documents/FreeAnchor/tools/train_net.py", line 164, in main
model = train(cfg, args.local_rank, args.distributed)
File "/media/zy/Documents/FreeAnchor/tools/train_net.py", line 73, in train
arguments,
File "/media/zy/Documents/FreeAnchor/maskrcnn_benchmark/engine/trainer.py", line 56, in do_train
for iteration, (images, targets, _) in enumerate(data_loader, start_iter):
File "/media/zy/Software/miniconda/envs/free_anchor/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 582, in next
return self._process_next_batch(batch)
File "/media/zy/Software/miniconda/envs/free_anchor/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 608, in _process_next_batch
raise batch.exc_type(batch.exc_msg)
IndexError: Traceback (most recent call last):
File "/media/zy/Software/miniconda/envs/free_anchor/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 "/media/zy/Software/miniconda/envs/free_anchor/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 "/media/zy/Documents/FreeAnchor/maskrcnn_benchmark/data/datasets/coco.py", line 58, in getitem
img, target = self.transforms(img, target)
File "/media/zy/Documents/FreeAnchor/maskrcnn_benchmark/data/transforms/transforms.py", line 15, in call
image, target = t(image, target)
File "/media/zy/Documents/FreeAnchor/maskrcnn_benchmark/data/transforms/transforms.py", line 70, in call
image, target = resizer(image, target)
File "/media/zy/Documents/FreeAnchor/maskrcnn_benchmark/data/transforms/transforms.py", line 58, in call
target = target.resize(image.size)
File "/media/zy/Documents/FreeAnchor/maskrcnn_benchmark/structures/bounding_box.py", line 124, in resize
v = v.resize(size, *args, **kwargs)
File "/media/zy/Documents/FreeAnchor/maskrcnn_benchmark/structures/segmentation_mask.py", line 184, in resize
scaled.append(polygon.resize(size, *args, **kwargs))
File "/media/zy/Documents/FreeAnchor/maskrcnn_benchmark/structures/segmentation_mask.py", line 117, in resize
p[0::2] *= ratio_w
IndexError: dimension specified as 0 but tensor has no dimensions
the version of pytorch is 1.1.0.
How to fix the problem
The text was updated successfully, but these errors were encountered: