Comments (7)
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.
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 arrayI 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.
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.
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.
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.
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 arrayI 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.
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 arrayI 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)
- Tips for training from scratch
- 训练的时候出现RuntimeError !! HOT 2
- how to choose the best model for test images?model_best.pt or model_latest.pt ?
- About test on Set5 dataset
- The Training time increasses while increasing the number of GPU
- About test on Set14
- How to divide the image into patches?
- NameError: ForkingPickler(file, protocol).dump(obj) name 'torch' is not definedBrokenPipeError : [Errno 32] Broken pipe
- About the calculation of PSNR
- RuntimeError:
- Understanding the whole process
- RCAN: tail module
- Can you provide the change curve of psnr during your training?
- batchsize=1
- How do self-ensemble
- The output value explode
- PSNR Problem
- Baidu download link in the “The whole test pipeline” is not useful
- 为什么使用--chop和不使用--chop得到的结果不一样
- 训练中断了,我应该修改哪里的代码继续训练
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rcan.