PiCANet-Implementation icon indicating copy to clipboard operation
PiCANet-Implementation copied to clipboard

数据集问题

Open 18718277909 opened this issue 4 years ago • 5 comments

你好, 感谢你所做的贡献。 请问我在用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’,请问能否解答一下,谢谢

18718277909 avatar Nov 25 '20 05:11 18718277909

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.

Ugness avatar Nov 25 '20 06:11 Ugness

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

18718277909 avatar Nov 25 '20 07:11 18718277909

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

Ugness avatar Nov 25 '20 12:11 Ugness

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?

18718277909 avatar Nov 27 '20 06:11 18718277909

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

  • google "tqdm printing to newline"
    • https://stackoverflow.com/questions/41707229/tqdm-printing-to-newline
  • update tqdm version
  • or disable the tqdm logger. It does not relate to the performance of the network.

Ugness avatar Nov 27 '20 07:11 Ugness