Closed lhwwhl closed 5 years ago
@lhwwhl Sorry for the late response. You are right, the parameters are forgotten to update. I fixed this issue. Please try again :).
Using "python3 run.py --model vespcn --dataset mcl-v test none", I can train successfully. But in test, "python3 run.py --model vespcn --test mcl-v", cause some problem:
Caused by op 'vespcn/MotionEstimation/add', defined at:
File "run.py", line 47, in
InvalidArgumentError (see above for traceback): Incompatible shapes: [1,272,480] vs. [1,270,480] [[Node: vespcn/MotionEstimation/add = Add[T=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:GPU:0"](vespcn/MotionEstimation/strided_slice, vespcn/MotionEstimation/strided_slice_17)]] [[Node: PSNR/All/_369 = _Recv[client_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device_incarnation=1, tensor_name="edge_998_PSNR/All", tensor_type=DT_BOOL, _device="/job:localhost/replica:0/task:0/device:CPU:0"]()]]
I'm confused with it. Thank you!
@lhwwhl
In training, it crops input images to patches as 96x96 (args: patch_size
), but in testing, the input is the entire images.
As in this case, MCL-V's image is 1920x1080, and the test input with x4 down-sampled is 480x270, however, in VESPCN flow estimation uses 2 strided conv layers, which mean the feature size is down scaled to w/4xh/4, as 96 can be divided by 16, so training is fine, but 270 can't be divided by 4 (and it pads to 272, hence causes size mismatch between outputs and labels).
To address this problem, you can:
--add_custom_callbacks=pad
** the function pad
can be found in custom_api.py
.
[BUG WARNING]
~~I found that add_custom_callbacks
pads input features, but doesn't pad labels. So you still get exception while calculating metrics...
For now, you have to use --infer
to work around.~~
[BUG FIXED] Fixed this issue now. If there's any questions, feel free to let me know.
Note pad
pads inputs to be divided by 64, you can change corresponding value in custom_api.py
Could you share how to prepare mcl-v trainning data and test data? I only download some yuv videos...
@peppaseven Hi. Please refer to ./Data/datasets.yaml
, where I set MCL-V section to /mnt/data/datasets/MCL-V/train/*.yuv
.
MCL-V only has 12 video clips for training. Just copy/move these .yuv files together and modify the path in datasets.yaml
. VSR can read from YUV files directly. For testing and validation, I move 1 video from training folder into a testing folder. (See datasets.yaml:77
for details)
When you want to train with MCL-V, use python run.py --model=vespcn --dataset=mcl-v --threads=4 --memory_limit=1GB --epochs=200
, --memory_limit=1GB
will be needed because extract patches from MCL-V can reach to a huge memory allocation.
Thanks very much, I got this. so, only need randomly choose 12 videos clips as training set, others can be validation or testing set...right?
@peppaseven Yes. Mention that MCL-V only has 12 videos in total. So I use 11 of them to train, and 1 for test. Video dataset is surely a problem for VSR, especially compared to SISR. To extend MCL-V, I suggest to use GOPRO, a big ourdoor video dataset (organized as a series of PNG files) which contains 33 videos and thounds of frames in total.
I pick up the above as training set..
@peppaseven It's no problem. For example you just train without validation. And verify your model after training to test on other dataset (such as VID4).
Because in current version of VSR, we can't mix png files and raw files (such as .yuv) together for training and validation. A pratical solution is to move one of the file (i.e. Tennis_24fps.yuv) out of training folder and use it as a validation file.
thanks, actually, i just want to prepare training data for "HDRNET", want to find a good algorithm with whole training pipeline, when get training set, after tested that, choose this as training set for HDRNET. as we know, it it so difficult to prepare a training set with pictures retouched by adobe lightroom expert...until now, can't find a good algorithm for video enhancement. any advice for this?
@peppaseven I know little about this field. There do exist some works to HDR photo using CNN, as for video, I think the refining method may be the same as we do in VSR or video style transfer: motion-compensation and Conv3D.
I'm really appreciate your sharing of this project . But I just started it, in vespcn.yaml, lr_decay: 1 would cause some problems. Traceback (most recent call last): File "run.py", line 47, in
tf.app.run(main)
File "/usr/local/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 125, in run
_sys.exit(main(argv))
File "run.py", line 36, in main
return Run.run(additional_functions)
File "/Users/lhw/Worker/learn/opensrc/SR/VideoSuperResolution/VSR/Tools/Run.py", line 158, in run
train_config, test_config, infer_config = init_loader_config(opt)
File "/Users/lhw/Worker/learn/opensrc/SR/VideoSuperResolution/VSR/Tools/Run.py", line 107, in init_loader_config
train_config.lr_schedule = lr_decay(lr=opt.lr, opt.lr_decay)
TypeError: lr_decay() argument after ** must be a mapping, not int.
Could you share your config? I'm looking forward to your reply, Thank you!