LoSealL / VideoSuperResolution

A collection of state-of-the-art video or single-image super-resolution architectures, reimplemented in tensorflow.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error During Training in Numpy Concatenate Function

cloudlakecho opened this issue · comments

I am facing error during training. The function is np.concatenate.

It looks like my images in the dataset need to be the same size...

File: VSR\DataLoader\Loader.py

Code line: pack['hr'] = np.concatenate(pack['hr'])

Here is error Message:

.
.
.
 99%|#############################7| 198/200 [00:05<00:00, 33.51batch/s, loss=185.71356]
Traceback (most recent call last):
  File "train.py", line 154, in <module>
    main()
  File "train.py", line 148, in main
    t.fit([lt, lv], config)
  File "c:\code\videosuperresolution\VSR\Backend\TF\Framework\Trainer.py", line 352, in fit
    self.fn_train_each_epoch()
  File "c:\code\videosuperresolution\VSR\Backend\TF\Framework\Trainer.py", line 270, in fn_train_each_epoch
    for items in r:
  File "C:\Users\ccho\AppData\Local\conda\conda\envs\enntri\lib\site-packages\tqdm\std.py", line 1127, in __iter__
    for obj in iterable:
  File "c:\code\videosuperresolution\VSR\DataLoader\Loader.py", line 148, in __next__
    pack['hr'] = np.concatenate(pack['hr'])
  File "<__array_function__ internals>", line 6, in concatenate
ValueError: all the input array dimensions for the concatenation axis must match exactly, but along dimension 2, the array at index 0 has size 63 and the array at index 3 has size 18

Neural network: SRCNN and ESPCN

Dataset: Waterloo

To reproduce my error:
python train.py srcnn --dataset waterloo --pretrain="../Results/srcnn_uda/save" --epochs=1000 -cuda or
python train.py espcn --dataset waterloo --pretrain="../Results/espcn/save" --epochs=1000 --cuda

Setting: scale 9 and batch 4.

I searched Issues in the repository, but it looks like no one had this problem.

Do I miss anything?

Thanks.

Scale=9 seems to large...

  • First, it doesn't suit for simple networks such SRCNN
  • Second, the batch_size=64 is not divisible by 9