thangvubk / PESR

Official code (Pytorch) for paper Perception-Enhanced Single Image Super-Resolution via Relativistic Generative Networks

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AssertionError: size of input tensor and input format are different.

Marshall-yao opened this issue · comments

Hi ,thanks for your wonderful work .

When i retrained the work, I downloaded datasets and put them into data/origin dirctory.

Then i pretrained the code with command of python train.py --phase pretrain --learning_rate 1e-4.

However, it gave the error as follows:
Model check_point/my_model. Epoch [1/200]. Learning rate: 0.0001
100%|████████████████████████████████████████████████████████████████████████| 1000/1000 [04:41<00:00, 3.56it/s]
Finish train [1/200]. Loss: 8.88

Validating...
0%| | 0/10 [00:02<?, ?it/s]
Traceback (most recent call last):
File "train.py", line 314, in
main()
File "train.py", line 291, in main
update_tensorboard(epoch, tb, i, lr, sr, hr)
File "/home/18PESR-master/utils.py", line 47, in update_tensorboard
tb.add_image(str(img_idx) + '_LR', inp, epoch)
File "/home/anaconda3/lib/python3.5/site-packages/tensorboardX/writer.py", line 548, in add_image
image(tag, img_tensor, dataformats=dataformats), global_step, walltime)
File "/home/anaconda3/lib/python3.5/site-packages/tensorboardX/summary.py", line 211, in image
tensor = convert_to_HWC(tensor, dataformats)
File "/home/anaconda3/lib/python3.5/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, 3, 155, 103), input_format: CHW

Did you have any idea about this question?

Thanks .
Best regards.

As the error suggests, it might due to the format of the output is not compatible with the required format for tensorboard visualization. I will check and let you know.

@thangvubk

Thanks for your reply.

I have been solved this problem .There is no bug about your code .

Nice :)

Thanks .

Do you have any idea about my another problem of finetune ? I googled , but have not found solution.

what is the problem?

#6

the new question released on your project PESR github .

@thangvubk

Thanks for your reply.

I have been solved this problem .There is no bug about your code .

I also encountered the same problem. What is your solution?

@thangvubk

Thanks for your reply.

I have been solved this problem .There is no bug about your code .

I also encountered the same problem, how to tackle it?

@Aaradhy8989 @songyi1999,
can you post the error log here.