Closed lemyanh2612 closed 2 years ago
I have 2 issues with a custom dataset:
- My custom dataset is grayscale image, What should I change in transform.py?
- The second as the below comment:
Traceback (most recent call last): File "tools/train_net.py", line 226, in <module> main() File "tools/train_net.py", line 219, in #main model = train(cfg, args.local_rank, args.distributed) File "tools/train_net.py", line 101, in train arguments, File "/home/hungle/anaconda3/envs/mega.pytorch/mega_core/engine/trainer.py", line 72, in do_train for iteration, (images, targets) in enumerate(data_loader, start_iter): #(images, targets, _) File "/home/hungle/anaconda3/envs/MEGA/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 346, in __next__ data = self._dataset_fetcher.fetch(index) # may raise StopIteration File "/home/hungle/anaconda3/envs/MEGA/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/hungle/anaconda3/envs/MEGA/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in <listcomp> data = [self.dataset[idx] for idx in possibly_batched_index] File "/home/hungle/anaconda3/envs/mega.pytorch/mega_core/data/datasets/did.py", line 74, in __getitem__ return self._get_train(idx) File "/home/hungle/anaconda3/envs/mega.pytorch/mega_core/data/datasets/did.py", line 87, in _get_train img, target = self.transforms(img, target) TypeError: __call__() takes 2 positional arguments but 3 were given Traceback (most recent call last): File "/home/hungle/anaconda3/envs/MEGA/lib/python3.7/runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "/home/hungle/anaconda3/envs/MEGA/lib/python3.7/runpy.py", line 85, in _run_code exec(code, run_globals) File "/home/hungle/anaconda3/envs/MEGA/lib/python3.7/site-packages/torch/distributed/launch.py", line 253, in <module> main() File "/home/hungle/anaconda3/envs/MEGA/lib/python3.7/site-packages/torch/distributed/launch.py", line 249, in main cmd=cmd) subprocess.CalledProcessError: Command '['/home/hungle/anaconda3/envs/MEGA/bin/python', '-u', 'tools/train_net.py', '--local_rank=0', '--master_port=40605', '--config-file', 'configs/BASE_RCNN_1gpu.yaml', '--motion-specific', 'OUTPUT_DIR', 'training_dir/BASE_RCNN_1gpu']' returned non-zero exit status 1.
Thank you for your support
I have 2 issues with a custom dataset:
My custom dataset is grayscale image, What should I change in transform.py?
The second as the below comment:
Thank you for your support