You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi. I encountered with the following error while training:
`Prepare Data...
Traceback (most recent call last):
File "main.py", line 53, in
tf.app.run()
File "/home/hermes/.local/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 124, in run sys.exit(main(argv))
File "main.py", line 45, in main
rdn.train(FLAGS)
File "/home/hermes/RDN-TensorFlow-master/model.py", line 272, in train
input_setup(config)
File "/home/hermes/RDN-TensorFlow-master/utils.py", line 194, in input_setup
make_sub_data(data, config)
File "/home/hermes/RDN-TensorFlow-master/utils.py", line 126, in make_sub_data
input, label_, = preprocess(data[i], config.scale, eng, mdouble)
File "/home/hermes/RDN-TensorFlow-master/utils.py", line 55, in preprocess
label_ = modcrop(img, scale)
File "/home/hermes/RDN-TensorFlow-master/utils.py", line 45, in modcrop
img = img[0:h, 0:w, :]
TypeError: slice indices must be integers or None or have an index method`
I used python3 branch. Also I should mention that I put all images to RDN-TensorFlow/Train/DIV2K_train_HR.
What should I do now?
Thanks
The text was updated successfully, but these errors were encountered:
@moeinsamadi
hi, this error is caused by python3 version. In python3 branch, the / is float number division , while // is division for integer. So, you have to complete this modification of line (43、44、48、49、155、156) in utils.py.
BTW, could you please share your hyperprameters configuration?
@LiUzHiAn
Thank you very much. It is working now!
These are the hyperparameters:
flags.DEFINE_integer("image_size", 32, "the size of image input")
flags.DEFINE_integer("c_dim", 3, "the size of channel")
flags.DEFINE_integer("scale", 3, "the size of scale factor for preprocessing input image")
flags.DEFINE_integer("stride", 16, "the size of stride")
flags.DEFINE_integer("epoch", 2, "number of epoch")
flags.DEFINE_integer("batch_size", 128, "the size of batch")
flags.DEFINE_float("learning_rate", 1e-4 , "the learning rate")
flags.DEFINE_integer("D", 5, "D")
flags.DEFINE_integer("C", 3, "C")
flags.DEFINE_integer("G", 64, "G")
flags.DEFINE_integer("G0", 64, "G0")
flags.DEFINE_integer("kernel_size", 3, "the size of kernel")
Training seems to be so time consuming! I ran the training on a laptop with Intel R Core i5 CPU M 480 2.67GHz × 4 and 3.7 GiB Memory. Training time for each epoch was approximately 3 hour!
I only changed "batch_size" from 64 (default) to 128.
Hi. I encountered with the following error while training:
`Prepare Data...
Traceback (most recent call last):
File "main.py", line 53, in
tf.app.run()
File "/home/hermes/.local/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 124, in run
sys.exit(main(argv))
File "main.py", line 45, in main
rdn.train(FLAGS)
File "/home/hermes/RDN-TensorFlow-master/model.py", line 272, in train
input_setup(config)
File "/home/hermes/RDN-TensorFlow-master/utils.py", line 194, in input_setup
make_sub_data(data, config)
File "/home/hermes/RDN-TensorFlow-master/utils.py", line 126, in make_sub_data
input, label_, = preprocess(data[i], config.scale, eng, mdouble)
File "/home/hermes/RDN-TensorFlow-master/utils.py", line 55, in preprocess
label_ = modcrop(img, scale)
File "/home/hermes/RDN-TensorFlow-master/utils.py", line 45, in modcrop
img = img[0:h, 0:w, :]
TypeError: slice indices must be integers or None or have an index method`
I used
python3
branch. Also I should mention that I put all images to RDN-TensorFlow/Train/DIV2K_train_HR.What should I do now?
Thanks
The text was updated successfully, but these errors were encountered: