Dootmaan / DSRL

Implementation of CVPR 2020 Dual Super-Resolution Learning for Semantic Segmentation
MIT License
96 stars 17 forks source link

Some problem about Data processing during training with Cityscapes #22

Open Lecxxx opened 11 months ago

Lecxxx commented 11 months ago

I encountered the following issues during training:

Traceback (most recent call last): File "/data2/zixuan/DSRL-subpixel/train.py", line 313, in main() File "/data2/zixuan/DSRL-subpixel/train.py", line 306, in main trainer.training(epoch) File "/data2/zixuan/DSRL-subpixel/train.py", line 110, in training output,output_sr,fea_seg,fea_sr = self.model(input_img) File "/home/zixuan/anaconda3/envs/DSRL/lib/python3.6/site-packages/torch/nn/modules/module.py", line 727, in _call_impl result = self.forward(*input, kwargs) File "/home/zixuan/anaconda3/envs/DSRL/lib/python3.6/site-packages/torch/nn/parallel/data_parallel.py", line 159, in forward return self.module(*inputs[0], *kwargs[0]) File "/home/zixuan/anaconda3/envs/DSRL/lib/python3.6/site-packages/torch/nn/modules/module.py", line 727, in _call_impl result = self.forward(input, kwargs) File "/data2/zixuan/DSRL-subpixel/modeling/deeplab.py", line 46, in forward x = self.aspp(x) File "/home/zixuan/anaconda3/envs/DSRL/lib/python3.6/site-packages/torch/nn/modules/module.py", line 727, in _call_impl result = self.forward(*input, kwargs) File "/data2/zixuan/DSRL-subpixel/modeling/aspp.py", line 70, in forward x5 = self.global_avg_pool(x) File "/home/zixuan/anaconda3/envs/DSRL/lib/python3.6/site-packages/torch/nn/modules/module.py", line 727, in _call_impl result = self.forward(*input, *kwargs) File "/home/zixuan/anaconda3/envs/DSRL/lib/python3.6/site-packages/torch/nn/modules/container.py", line 117, in forward input = module(input) File "/home/zixuan/anaconda3/envs/DSRL/lib/python3.6/site-packages/torch/nn/modules/module.py", line 727, in _call_impl result = self.forward(input, kwargs) File "/home/zixuan/anaconda3/envs/DSRL/lib/python3.6/site-packages/torch/nn/modules/batchnorm.py", line 136, in forward self.weight, self.bias, bn_training, exponential_average_factor, self.eps) File "/home/zixuan/anaconda3/envs/DSRL/lib/python3.6/site-packages/torch/nn/functional.py", line 2054, in batch_norm _verify_batch_size(input.size()) File "/home/zixuan/anaconda3/envs/DSRL/lib/python3.6/site-packages/torch/nn/functional.py", line 2037, in _verify_batch_size raise ValueError('Expected more than 1 value per channel when training, got input size {}'.format(size)) ValueError: Expected more than 1 value per channel when training, got input size torch.Size([1, 256, 1, 1])

May I ask if there is an error downloading my data or if there is an issue with my model parameter settings? Can you please refer to your format for storing Cityscapes data?

Lecxxx commented 11 months ago

Hello, I just found out in the experiment that this is due to my batchsize setting. The above error occurred because I set the batchsize to 1. May I ask if the model can set the batchsize to 1?

Only when the batch size is set to exactly cover the entire dataset can normal training be performed, such as training with a data volume of 2975 and setting the batch size to 5.

Tou-ge commented 11 months ago

Hello, I also want to conduct experiments on Cityscapes data recently, but I have encountered some issues with the dataset. Could you please share with me the dataset you used through email? Thank you very much.

Lecxxx commented 10 months ago

@Tou-ge Hello! I apologize for replying to your question after a few days.

Hello, I also want to conduct experiments on Cityscapes data recently, but I have encountered some issues with the dataset. Could you please share with me the dataset you used through email? Thank you very much.

You can find a dataset on Cityscapes' official website. Here is its official download page. https://www.cityscapes-dataset.com/downloads/