nagadomi / waifu2x

Image Super-Resolution for Anime-Style Art
http://waifu2x.udp.jp/
MIT License
27.54k stars 2.71k forks source link

Error in torch.random #246

Open TheDeadCode opened 6 years ago

TheDeadCode commented 6 years ago

Goal

Make a 4x upscale model

My Dataset

10,000 images in 1920x1080

Error

/root/torch/install/bin/luajit: lib/pairwise_transform_utils.lua:85: bad argument #1 to 'random' (upper bound must be larger than lower bound at /root/torch/pkg/torch/build/TensorMath.c:62914)
stack traceback:
    [C]: in function 'random'
    lib/pairwise_transform_utils.lua:85: in function 'active_cropping'
    lib/pairwise_transform_scale.lua:44: in function 'transformer'
    train.lua:51: in function 'make_validation_set'
    train.lua:327: in function 'train'
    train.lua:460: in main chunk
    [C]: in function 'dofile'
    /root/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:150: in main chunk
    [C]: at 0x00405d50

Config

{
  active_cropping_rate : 0.5
  batch_size : 16
  name : "user"
  method : "scale"
  max_size : 256
  validation_crops : 200
  plot : false
  patches : 64
  save_history : true
  resize_blur_max : 1.05
  gpu : -1
  test : "query/pixel-art-small.png"
  downsampling_filters :
    {
      1 : "Box"
      2 : "Lanczos"
      3 : "Sinc"
    }
  resume : ""
  crop_size : 48
  random_color_noise_rate : 0
  model_file_best : "models/custom/scale4.0x_model.t7"
  seed : 11
  image_list : "./data/image_list.txt"
  images : "./data/images.t7"
  resize_blur_min : 0.95
  nr_rate : 0.65
  model_file : "models/custom/scale4.0x_model.%d-%d.t7"
  learning_rate_decay : 3e-07
  model : "upconv_7"
  active_cropping_tries : 10
  use_transparent_png : false
  oracle_drop_rate : 0.5
  inner_epoch : 2
  random_overlay_rate : 0
  epoch : 100
  data_dir : "./data"
  learning_rate : 0.00025
  random_half_rate : 0
  scale : 4
  jpeg_chroma_subsampling_rate : 0.5
  max_training_image_size : -1
  oracle_rate : 0
  model_dir : "models/custom"
  style : "art"
  random_unsharp_mask_rate : 0
  color : "rgb"
  noise_level : 1
  backend : "cudnn"
  validation_rate : 0.05
  thread : 8
}

Other Notes

We have an option to use upconv_8_4x in -model, but it seems not implemented, or missing:

/root/torch/install/bin/luajit: lib/srcnn.lua:282: unsupported model_name: upconv_8_4x
stack traceback:
    [C]: in function 'error'
    lib/srcnn.lua:282: in function 'create'
    train.lua:302: in function 'train'
    train.lua:460: in main chunk
    [C]: in function 'dofile'
    /root/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:150: in main chunk
    [C]: at 0x00405d50

Is this expected behaviour?

Thank you!

TheDeadCode commented 6 years ago

I forgot to mention I tried the solution in #40, but to no avail. Hence this issue.

nagadomi commented 6 years ago

upconv_7 has only one deconvolution layer, so the output is 2x. 4x training is not supported currently.

TheDeadCode commented 6 years ago

Is upconv_8_4x being implemented currently? I saw it in a few places in the code

nagadomi commented 6 years ago

It was experimentally implemented, but now it has been removed.