Giter Site home page Giter Site logo

problems in training about rcan HOT 7 OPEN

yulunzhang avatar yulunzhang commented on August 14, 2024
problems in training

from rcan.

Comments (7)

LeBronPrince avatar LeBronPrince commented on August 14, 2024

Hello,thanks for sharing the source code and experimental results.
I want to train a model with my own dataset, but there exist some problems in the process of training, hoping you can give some suggestion, I will be very appreciate!

the problem described as below:
Preparing loss function:
1.000 * L1
[Epoch 1] Learning rate: 1.00e-4
Traceback (most recent call last):
File "main.py", line 19, in
t.train()
File "/home/weihq/superresolution1/RCAN-master/RCAN-master/RCAN_TrainCode/code/trainer.py", line 45, in train
for batch, (lr, hr, _, idx_scale) in enumerate(self.loader_train):
File "/home/weihq/anaconda3/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 286, in next
return self._process_next_batch(batch)
File "/home/weihq/anaconda3/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 307, in _process_next_batch
raise batch.exc_type(batch.exc_msg)
IndexError: Traceback (most recent call last):
File "/home/weihq/superresolution1/RCAN-master/RCAN-master/RCAN_TrainCode/code/dataloader.py", line 47, in _ms_loop
samples = collate_fn([dataset[i] for i in batch_indices])
File "/home/weihq/superresolution1/RCAN-master/RCAN-master/RCAN_TrainCode/code/dataloader.py", line 47, in
samples = collate_fn([dataset[i] for i in batch_indices])
File "/home/weihq/superresolution1/RCAN-master/RCAN-master/RCAN_TrainCode/code/data/srdata.py", line 90, in getitem
lr, hr = self._get_patch(lr, hr)
File "/home/weihq/superresolution1/RCAN-master/RCAN-master/RCAN_TrainCode/code/data/srdata.py", line 126, in _get_patch
lr, hr, patch_size, scale, multi_scale=multi_scale
File "/home/weihq/superresolution1/RCAN-master/RCAN-master/RCAN_TrainCode/code/data/common.py", line 22, in get_patch
img_in = img_in[iy:iy + ip, ix:ix + ip, :]
IndexError: too many indices for array

I met the same issue with you.how did you solve it? thank you!

from rcan.

meroluo avatar meroluo commented on August 14, 2024

Hello,thanks for sharing the source code and experimental results.
I want to train a model with my own dataset, but there exist some problems in the process of training, hoping you can give some suggestion, I will be very appreciate!
the problem described as below:
Preparing loss function:
1.000 * L1
[Epoch 1] Learning rate: 1.00e-4
Traceback (most recent call last):
File "main.py", line 19, in
t.train()
File "/home/weihq/superresolution1/RCAN-master/RCAN-master/RCAN_TrainCode/code/trainer.py", line 45, in train
for batch, (lr, hr, _, idx_scale) in enumerate(self.loader_train):
File "/home/weihq/anaconda3/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 286, in next
return self._process_next_batch(batch)
File "/home/weihq/anaconda3/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 307, in _process_next_batch
raise batch.exc_type(batch.exc_msg)
IndexError: Traceback (most recent call last):
File "/home/weihq/superresolution1/RCAN-master/RCAN-master/RCAN_TrainCode/code/dataloader.py", line 47, in _ms_loop
samples = collate_fn([dataset[i] for i in batch_indices])
File "/home/weihq/superresolution1/RCAN-master/RCAN-master/RCAN_TrainCode/code/dataloader.py", line 47, in
samples = collate_fn([dataset[i] for i in batch_indices])
File "/home/weihq/superresolution1/RCAN-master/RCAN-master/RCAN_TrainCode/code/data/srdata.py", line 90, in getitem
lr, hr = self._get_patch(lr, hr)
File "/home/weihq/superresolution1/RCAN-master/RCAN-master/RCAN_TrainCode/code/data/srdata.py", line 126, in _get_patch
lr, hr, patch_size, scale, multi_scale=multi_scale
File "/home/weihq/superresolution1/RCAN-master/RCAN-master/RCAN_TrainCode/code/data/common.py", line 22, in get_patch
img_in = img_in[iy:iy + ip, ix:ix + ip, :]
IndexError: too many indices for array

I met the same issue with you.how did you solve it? thank you!

Actually, I have not solve it now, but I guess this may be because there are single-channel images or multi-channel (more than 3 channels) images in dataset, you can check with your dataset first.

from rcan.

yulunzhang avatar yulunzhang commented on August 14, 2024

Hi,
Yes, I also think it's about the channel numbers of the input and output. Please modify some parts in some files, e.g., rcan.py, div2k.py, opt.py. Be careful about the data channel.

from rcan.

meroluo avatar meroluo commented on August 14, 2024

Hi,
Yes, I also think it's about the channel numbers of the input and output. Please modify some parts in some files, e.g., rcan.py, div2k.py, opt.py. Be careful about the data channel.

Hello, I want to know that, whether the datasets can only contain the same channel images. When I use dataset containing both one channel and three channels images, there will be an error, that is "img_in = img_in[iy:iy + ip, ix:ix + ip, :] IndexError: too many indices for array".
How can I modify the file to use both types of images to train my model?

from rcan.

maxuba avatar maxuba commented on August 14, 2024

Hi,
Yes, I also think it's about the channel numbers of the input and output. Please modify some parts in some files, e.g., rcan.py, div2k.py, opt.py. Be careful about the data channel.

Hello, I want to know that, whether the datasets can only contain the same channel images. When I use dataset containing both one channel and three channels images, there will be an error, that is "img_in = img_in[iy:iy + ip, ix:ix + ip, :] IndexError: too many indices for array".
How can I modify the file to use both types of images to train my model?

Hi, I met the same problem now, did you solve it now? Would you share the approach with us? Thank you.

from rcan.

maxuba avatar maxuba commented on August 14, 2024

Hello,thanks for sharing the source code and experimental results.
I want to train a model with my own dataset, but there exist some problems in the process of training, hoping you can give some suggestion, I will be very appreciate!
the problem described as below:
Preparing loss function:
1.000 * L1
[Epoch 1] Learning rate: 1.00e-4
Traceback (most recent call last):
File "main.py", line 19, in
t.train()
File "/home/weihq/superresolution1/RCAN-master/RCAN-master/RCAN_TrainCode/code/trainer.py", line 45, in train
for batch, (lr, hr, _, idx_scale) in enumerate(self.loader_train):
File "/home/weihq/anaconda3/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 286, in next
return self._process_next_batch(batch)
File "/home/weihq/anaconda3/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 307, in _process_next_batch
raise batch.exc_type(batch.exc_msg)
IndexError: Traceback (most recent call last):
File "/home/weihq/superresolution1/RCAN-master/RCAN-master/RCAN_TrainCode/code/dataloader.py", line 47, in _ms_loop
samples = collate_fn([dataset[i] for i in batch_indices])
File "/home/weihq/superresolution1/RCAN-master/RCAN-master/RCAN_TrainCode/code/dataloader.py", line 47, in
samples = collate_fn([dataset[i] for i in batch_indices])
File "/home/weihq/superresolution1/RCAN-master/RCAN-master/RCAN_TrainCode/code/data/srdata.py", line 90, in getitem
lr, hr = self._get_patch(lr, hr)
File "/home/weihq/superresolution1/RCAN-master/RCAN-master/RCAN_TrainCode/code/data/srdata.py", line 126, in _get_patch
lr, hr, patch_size, scale, multi_scale=multi_scale
File "/home/weihq/superresolution1/RCAN-master/RCAN-master/RCAN_TrainCode/code/data/common.py", line 22, in get_patch
img_in = img_in[iy:iy + ip, ix:ix + ip, :]
IndexError: too many indices for array

I met the same issue with you.how did you solve it? thank you!

So do you handle it? how to do with this issue? Could you share your approach. Thank you.

from rcan.

countingstarsmer avatar countingstarsmer commented on August 14, 2024

Hello,thanks for sharing the source code and experimental results.
I want to train a model with my own dataset, but there exist some problems in the process of training, hoping you can give some suggestion, I will be very appreciate!
the problem described as below:
Preparing loss function:
1.000 * L1
[Epoch 1] Learning rate: 1.00e-4
Traceback (most recent call last):
File "main.py", line 19, in
t.train()
File "/home/weihq/superresolution1/RCAN-master/RCAN-master/RCAN_TrainCode/code/trainer.py", line 45, in train
for batch, (lr, hr, _, idx_scale) in enumerate(self.loader_train):
File "/home/weihq/anaconda3/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 286, in next
return self._process_next_batch(batch)
File "/home/weihq/anaconda3/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 307, in _process_next_batch
raise batch.exc_type(batch.exc_msg)
IndexError: Traceback (most recent call last):
File "/home/weihq/superresolution1/RCAN-master/RCAN-master/RCAN_TrainCode/code/dataloader.py", line 47, in _ms_loop
samples = collate_fn([dataset[i] for i in batch_indices])
File "/home/weihq/superresolution1/RCAN-master/RCAN-master/RCAN_TrainCode/code/dataloader.py", line 47, in
samples = collate_fn([dataset[i] for i in batch_indices])
File "/home/weihq/superresolution1/RCAN-master/RCAN-master/RCAN_TrainCode/code/data/srdata.py", line 90, in getitem
lr, hr = self._get_patch(lr, hr)
File "/home/weihq/superresolution1/RCAN-master/RCAN-master/RCAN_TrainCode/code/data/srdata.py", line 126, in _get_patch
lr, hr, patch_size, scale, multi_scale=multi_scale
File "/home/weihq/superresolution1/RCAN-master/RCAN-master/RCAN_TrainCode/code/data/common.py", line 22, in get_patch
img_in = img_in[iy:iy + ip, ix:ix + ip, :]
IndexError: too many indices for array

I met the same issue with you.how did you solve it? thank you!

So do you handle it? how to do with this issue? Could you share your approach. Thank you.

Could you share your approach. Thank you.

from rcan.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.