hh23333 / TSD

MIT License
5 stars 1 forks source link

img和mask大小不相同 #5

Open LinranQi opened 1 month ago

LinranQi commented 1 month ago

作者您好,我刚接触occluded person re-identification这个方向,并对您这篇文章的工作很感兴趣,我在运行程序的时候出现了以下错误不知道怎么解决,希望能得到您的帮助。我按照文档说明准备好data文件夹,并运行train_tsd.py文件,运行过程中在processor_tsd.py文件中for n_iter, (img, vid, target_cam, target_view, mask) in enumerate(train_loader):代码句读取数据时经过result = self.transform(load_dict) 出现错误 ValueError: Caught ValueError in DataLoader worker process 0. Original Traceback (most recent call last): File "/anaconda3/envs/CCreid/lib/python3.7/site-packages/torch/utils/data/_utils/worker.py", line 302, in _worker_loop data = fetcher.fetch(index) File "/anaconda3/envs/CCreid/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 58, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "/anaconda3/envs/CCreid/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 58, in data = [self.dataset[idx] for idx in possibly_batched_index] File "/TSD/datasets/bases.py", line 167, in getitem result = self.transform(load_dict)
File "/anaconda3/envs/CCreid/lib/python3.7/site-packages/albumentations/core/composition.py", line 195, in call self._check_args(**data) File "/anaconda3/envs/CCreid/lib/python3.7/site-packages/albumentations/core/composition.py", line 287, in _check_args "Height and Width of image, mask or masks should be equal. You can disable shapes check " ValueError: Height and Width of image, mask or masks should be equal. You can disable shapes check by setting a parameter is_check_shapes=False of Compose class (do it only if you are sure about your data consistency). 我调试时发现class ImageDataset_M(Dataset)类中getitem方法下读取到的img和mask大小是不相同的,请问该怎么解决这个问题。期待您的回复。

hh23333 commented 1 month ago

试试将is_check_shapes设置程False吧

LinranQi commented 1 month ago

试试将is_check_shapes设置程False吧

好的,感谢您的帮助。