Open di-dii opened 3 years ago
Hitching your question, can I ask how did you use your own dataset since there's no train_dir args and does it use the coco dataset format?
I also can't use it for detection! tried removing anything mask-related from the configs but can't make it work.
You should comment out all 'mask' related in
What specific settings of mask do I need to comment out
thank you for your great work, but there is a problem when i train with my own data i can't figure out why this happen i've changed all num_class to my num this is traceback:
Traceback (most recent call last): File "./tools/train.py", line 187, in
main()
File "./tools/train.py", line 183, in main
meta=meta)
File "/home/ding/chenTY/Swin-Transformer-Object-Detection/mmdet/apis/train.py", line 185, in train_detector
runner.run(data_loaders, cfg.workflow)
File "/home/ding/miniconda3/envs/mmlab/lib/python3.7/site-packages/mmcv/runner/epoch_based_runner.py", line 125, in run
epoch_runner(data_loaders[i], **kwargs)
File "/home/ding/miniconda3/envs/mmlab/lib/python3.7/site-packages/mmcv/runner/epoch_based_runner.py", line 47, in train
for i, data_batch in enumerate(self.data_loader):
File "/home/ding/miniconda3/envs/mmlab/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 435, in next
data = self._next_data()
File "/home/ding/miniconda3/envs/mmlab/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 1085, in _next_data
return self._process_data(data)
File "/home/ding/miniconda3/envs/mmlab/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 1111, in _process_data
data.reraise()
File "/home/ding/miniconda3/envs/mmlab/lib/python3.7/site-packages/torch/_utils.py", line 428, in reraise
raise self.exc_type(msg)
cv2.error: Caught error in DataLoader worker process 0.
Original Traceback (most recent call last):
File "/home/ding/miniconda3/envs/mmlab/lib/python3.7/site-packages/torch/utils/data/_utils/worker.py", line 198, in _worker_loop
data = fetcher.fetch(index)
File "/home/ding/miniconda3/envs/mmlab/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/home/ding/miniconda3/envs/mmlab/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/home/ding/chenTY/Swin-Transformer-Object-Detection/mmdet/datasets/custom.py", line 193, in getitem
data = self.prepare_train_img(idx)
File "/home/ding/chenTY/Swin-Transformer-Object-Detection/mmdet/datasets/custom.py", line 216, in prepare_train_img
return self.pipeline(results)
File "/home/ding/chenTY/Swin-Transformer-Object-Detection/mmdet/datasets/pipelines/compose.py", line 40, in call
data = t(data)
File "/home/ding/chenTY/Swin-Transformer-Object-Detection/mmdet/datasets/pipelines/transforms.py", line 534, in call
self._pad_masks(results)
File "/home/ding/chenTY/Swin-Transformer-Object-Detection/mmdet/datasets/pipelines/transforms.py", line 515, in _pad_masks
results[key] = results[key].pad(pad_shape, pad_val=self.pad_val)
File "/home/ding/chenTY/Swin-Transformer-Object-Detection/mmdet/core/mask/structures.py", line 305, in pad
for mask in self.masks
File "/home/ding/chenTY/Swin-Transformer-Object-Detection/mmdet/core/mask/structures.py", line 305, in
for mask in self.masks
File "/home/ding/miniconda3/envs/mmlab/lib/python3.7/site-packages/mmcv/image/geometric.py", line 450, in impad
value=pad_val)
cv2.error: OpenCV(4.5.1) /tmp/pip-req-build-7m_g9lbm/opencv/modules/core/src/copy.cpp:1445: error: (-215:Assertion failed) top >= 0 && bottom >= 0 && left >= 0 && right >= 0 && _src.dims() <= 2 in function 'copyMakeBorder'