Ugness / PiCANet-Implementation

Pytorch Implementation of PiCANet: Learning Pixel-wise Contextual Attention for Saliency Detection
MIT License
180 stars 40 forks source link

数据集问题 #29

Open 18718277909 opened 3 years ago

18718277909 commented 3 years ago

你好, 感谢你所做的贡献。 请问我在用DUTS-TR数据集训练网络的时候,我把数据集按照说明需要的方式:images/a.jpg masks/a.jpg,这样放置了,但为什么还是报错‘size of input tensor and input format are different. tensor shape: (1, 1, 28, 28), input_format: CHW’,请问能否解答一下,谢谢

Ugness commented 3 years ago

Would you introduce the specific code line that the error occurs? Also, would you translate your question into English, please? I cannot read Chinese. It would be better to attach the English question and the Chinese question together.

18718277909 commented 3 years ago

Hello, Thank you for your contribution. When I use DUTS-TR data set to train the network, I put the data set in the way required by the instructions: images / a.jpg masks / a.jpg, but why is the error: 'File "train.py", line 108, in writer.add_image('{}'.format(masked.size()[2]), masked, global_step=iterate) File "C:\Users\admin.conda\envs\pytorch\lib\site-packages\tensorboardX\writer.py", line 608, in add_image image(tag, img_tensor, dataformats=dataformats), global_step, walltime) File "C:\Users\admin.conda\envs\pytorch\lib\site-packages\tensorboardX\summary.py", line 283, in image tensor = convert_to_HWC(tensor, dataformats) File "C:\Users\admin.conda\envs\pytorch\lib\site-packages\tensorboardX\utils.py", line 103, in convert_to_HWC tensor shape: {}, input_format: {}".format(tensor.shape, input_format) AssertionError: size of input tensor and input format are different. tensor shape: (1, 1, 28, 28), input_format: CHW Can you give me an answer please? Thank you

Ugness commented 3 years ago

I think your issue is related with https://github.com/Ugness/PiCANet-Implementation/issues/12#issuecomment-453928501. Please check your tensorboardX version. Thank you.

18718277909 commented 3 years ago

I think your issue is related with #12 (comment). Please check your tensorboardX version. Thank you.

Thank you for your help, but why I am training my dataset, it is

Epoch : 19 0%|▏ | 3/5019 [00:01<32:24, 2.58it/s] 0%|▏ | 4/5019 [00:01<32:40, 2.56it/s] 0%|▏ | 5/5019 [00:01<32:12, 2.60it/s] 0%|▎ | 6/5019 [00:02<33:35, 2.49it/s] 0%|▎ | 7/5019 [00:02<33:14, 2.51it/s] 0%|▎ | 8/5019 [00:03<32:43, 2.55it/s] 0%|▍ | 9/5019 [00:03<32:07, 2.60it/s] 0%|▍ | 10/5019 [00:03<32:03, 2.60it/s] 0%|▍ | 11/5019 [00:04<31:42, 2.63it/s] 0%|▍ | 11/5019 [00:04<32:29, 2.57it/s can you heip me please?

Ugness commented 3 years ago

That problem happened from the tqdm module. I do not know the exact solution, but I recommend you to