twke18 / SPML

Universal Weakly Supervised Segmentation by Pixel-to-Segment Contrastive Learning
https://twke18.github.io/projects/spml.html
MIT License
104 stars 26 forks source link

The relative path in your bash file fails to meet your dataset layout provided. #1

Closed liricky closed 3 years ago

liricky commented 3 years ago

When I am trying to test your project with the bash file (bashscripts/voc12/train_spml_scribble.sh) you provided, I found multiple errors in reading images, even if I have modified the DATAROOT in the bash file. The log is shown below: File "pyscripts/train/train.py", line 313, in main() File "pyscripts/train/train.py", line 163, in main train_iterator, gpu_ids) File "/home/liruiqi/code/SPML/spml/utils/general/others.py", line 63, in prepare_datas_and_labels_mgpu data, label, index = data_iterator.next() File "/home/liruiqi/anaconda3/envs/SPML/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 435, in next data = self._next_data() File "/home/liruiqi/anaconda3/envs/SPML/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 1085, in _next_data return self._process_data(data) File "/home/liruiqi/anaconda3/envs/SPML/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 1111, in _process_data data.reraise() File "/home/liruiqi/anaconda3/envs/SPML/lib/python3.6/site-packages/torch/_utils.py", line 428, in reraise raise self.exc_type(msg) FileNotFoundError: Caught FileNotFoundError in DataLoader worker process 0. Original Traceback (most recent call last): File "/home/liruiqi/anaconda3/envs/SPML/lib/python3.6/site-packages/torch/utils/data/_utils/worker.py", line 198, in _worker_loop data = fetcher.fetch(index) File "/home/liruiqi/anaconda3/envs/SPML/lib/python3.6/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "/home/liruiqi/anaconda3/envs/SPML/lib/python3.6/site-packages/torch/utils/data/_utils/fetch.py", line 44, in data = [self.dataset[idx] for idx in possibly_batched_index] File "/home/liruiqi/code/SPML/spml/data/datasets/list_tag_dataset.py", line 113, in getitem image, semantic_label, instance_label, semantic_tag = self._training_preprocess(idx) File "/home/liruiqi/code/SPML/spml/data/datasets/list_tag_dataset.py", line 88, in _training_preprocess image, semantic_label, instance_label, semantic_tags = self._get_datas_by_index(idx) File "/home/liruiqi/code/SPML/spml/data/datasets/list_tag_dataset.py", line 65, in _get_datas_by_index semantic_label = self._read_label(semantic_label_path) File "/home/liruiqi/code/SPML/spml/data/datasets/base_dataset.py", line 112, in _read_label return np.array(Image.open(label_path).convert(mode='L')) File "/home/liruiqi/anaconda3/envs/SPML/lib/python3.6/site-packages/PIL/Image.py", line 2968, in open fp = builtins.open(filename, "rb") FileNotFoundError: [Errno 2] No such file or directory: '/home/liruiqi/code/SPML/scribble_annotation/VOC2012/dilate_3/segcls/2008_004760.png'

I fail to find any guidance about the "scribble_annotation" in your README file, so I wish you can supplement such information or modify the README file.

Finally, thx for providing your code and wish you have a good day. XD!

twke18 commented 3 years ago

Thanks for pointing out the relative path errors! We've fixed the problem and updated the dataset files correspondingly. We also updated the information for processing scribble annotations in the READ.md.

liricky commented 3 years ago

Thx for your response.