Comments (4)
- The first error is that it is forcing the image size to mutiple of 4 when the scale is 1.
- Secondly, even thought it has cropped/expanded the image it still gives this error as it does not scale the corresponding lr image
LOGS:
The image size needs to be a multiple of 4. The loaded image size was (817, 398), so it was adjusted to (816, 400). This adjustment will be done to all images whose sizes are not multiples of 4.
The image size needs to be a multiple of 4. The loaded image size was (476, 485), so it was adjusted to (476, 484). This adjustment will be done to all images whose sizes are not multiples of 4.
Traceback (most recent call last):
File "train.py", line 417, in
main()
File "train.py", line 413, in main
fit(model, opt, dataloaders, steps_states, data_params, loggers)
File "train.py", line 215, in fit
for n, train_data in enumerate(dataloaders['train'], start=1):
File "/usr/local/lib/python3.7/dist-packages/torch/utils/data/dataloader.py", line 517, in next
data = self._next_data()
File "/usr/local/lib/python3.7/dist-packages/torch/utils/data/dataloader.py", line 1199, in _next_data
return self._process_data(data)
File "/usr/local/lib/python3.7/dist-packages/torch/utils/data/dataloader.py", line 1225, in _process_data
data.reraise()
File "/usr/local/lib/python3.7/dist-packages/torch/_utils.py", line 429, in reraise
raise self.exc_type(msg)
RuntimeError: Caught RuntimeError in DataLoader worker process 0.
Original Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/torch/utils/data/_utils/worker.py", line 202, in _worker_loop
data = fetcher.fetch(index)
File "/usr/local/lib/python3.7/dist-packages/torch/utils/data/_utils/fetch.py", line 47, in fetch
return self.collate_fn(data)
File "/usr/local/lib/python3.7/dist-packages/torch/utils/data/_utils/collate.py", line 73, in default_collate
return {key: default_collate([d[key] for d in batch]) for key in elem}
File "/usr/local/lib/python3.7/dist-packages/torch/utils/data/_utils/collate.py", line 73, in
return {key: default_collate([d[key] for d in batch]) for key in elem}
File "/usr/local/lib/python3.7/dist-packages/torch/utils/data/_utils/collate.py", line 55, in default_collate
return torch.stack(batch, 0, out=out)
RuntimeError: stack expects each tensor to be equal size, but got [3, 400, 816] at entry 0 and [3, 560, 464] at entry 1
I've ran the same dataset on the previous commits without raising this error on scale of 1(for denoising/deblurring).
My Hr_size is 256.
I will try preprocess flag next time i encounter the issue.
Thanks.
from trainner.
Hello! It's not forcing the image to a scale of 4, it's making sure the image has dimensions that are multiples of 4. That's a safe measure for any step that requires scaling internally, but this should only happen on it's own under specific circumstances.
What crop size (HR_size) are you using?
from trainner.
I think I know what the solution is. Try adding this:
preprocess: crop
Under this line in the options file: https://github.com/victorca25/BasicSR/blob/326b7062fb32464e6ce89388bec5b86c3943c7fb/codes/options/train/train_template.yml#L34
So it would look something like:
virtual_batch_size: 8
HR_size: 128
image_channels: 3
preprocess: crop
from trainner.
The new commits include this change, you should also be able to just pull the latest version and test if everything works as expected!
from trainner.
Related Issues (20)
- [Feature Request] Curriculum Training for Augmentations
- Pixel Unshuffle is broken HOT 2
- Video dataloader crashes at 1x scale
- Video learning rate too high
- Add lr_crop_size in config HOT 1
- Update requirements.txt with proper versioning for torch
- Feature request/bug fix: Perform scaling and other operations in linear light HOT 3
- `nearest_aligned` is not aligned HOT 2
- so many bugs in your sftgan implementation HOT 6
- How do i even use this HOT 2
- Is there any way to train video super resolution models using this? HOT 4
- lmdb has no valid image file HOT 3
- how to train for real ESRGAN HOT 1
- GPU usage at 0% during training HOT 7
- FutureWarning and UserWarning HOT 5
- I Have No Idea What I Am Doing to Cause This: HOT 5
- "cv2.error: OpenCV(4.7.0) D:\a\opencv-python\opencv-python\opencv\modules\imgproc\src\resize.cpp:4065: error: (-215:Assertion failed) inv_scale_x > 0 in function 'cv::resize'" HOT 1
- ETA is grossly over-estimated. HOT 2
- Pix2Pix 3->1 channel HOT 1
- AttributeError: module 'collections' has no attribute 'Iterable' HOT 1
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 trainner.