Comments (4)
I am also running into this issue. Any help from the devs or people who have successfully trained on their own data sets would be much appreciated!
from mmagic.
@ienko I have found a solution. The issue was in codes/data/LQGT_dataset.py
in the random crop step (around line 110). I rewrote the random crop algorithm like this:
gt_h = random.randint(0, max(0, gH - GT_size))
gt_w = random.randint(0, max(0, gW - GT_size))
img_GT = img_GT[gt_h:gt_h + GT_size, gt_w:gt_w + GT_size, :]
LQ_size = GT_size // scale
lq_h = gt_h // scale
lq_w = gt_w // scale
img_LQ = img_LQ[lq_h:lq_h + LQ_size, lq_w:lq_w + LQ_size, :]
and that fixed the error
from mmagic.
@PSZehnder great, thanks a lot.
I also managed to solve it in a similar way, with writing another code for preprocessing the dataset I had (needed 4:3 with specific resolutions).
imgScale = H/height
newX, newY = oriimg.shape[1]*imgScale, oriimg.shape[0]*imgScale
newimg = cv2.resize(oriimg, (int(newX), int(H)))
newWidth = int(W)
newHeight = int(H)
xBegin = (int(newX) - int(newWidth))/2
xEnd = int(xBegin) + int(newWidth)
cropped = newimg[0:1920, int(xBegin):int(xEnd)]
For some reason, it still doesn't work for all the batch sizes, but guess that's implied by network architecture.
from mmagic.
The model arch is such that it requires: (128,128,3) as GT (X) and (32,32,3) as LR (Y).
Keeping these two dimensions in mind, I was able to create my own dataset, then create it's corresponding lmdb files using the ./codes/data_scripts/create_lmdb.py and also validate the lmdb files created using the ./code/data_scrpits/test_dataloader.py file
Make sure that you have the correct paths present in the ./option/train/train_model.yaml file before starting the training. I hope if you adhere to these images dimensions you'll be able to fit a decent batch size depending upon your GPU memory available and start the training easily on the custom dataset.
from mmagic.
Related Issues (20)
- torch.cuda.OutOfMemoryError: CUDA out of memory.real_basicvsr/basicvsr++运行报错 HOT 2
- [Bug] Can not use `ConcatImageVisualizer` in train step. / 在Train阶段可视化存在bug
- [Feature] Training and Testing Support for Stable Diffusion
- [Bug] When I RUN the "QUICK RUN" in the documentation, something goes wrong
- [Bug] CUBLAS_STATUS_EXECUTION_FAILED error for BasicVSR_PP for tasks with resolutions >~1700x1080
- [Bug] Can not work HOT 1
- [Bug] BasicVSR++ epoch display
- Too long data_time in training of denoise and deblur models. And too low GPU utilization
- [Bug] linux环境,运行视频超分程序,中断 HOT 1
- ['AsymmetricAutoencoderKL is already registered in model at mmagic.models.archs'] HOT 2
- 文生图Demo执行后output图片生成不出来[Bug] HOT 1
- Swinir training configuration issue?[Bug] HOT 1
- [Bug] AttributeError: 'EditDDIMScheduler' object has no attribute 'sample_timestep'
- [Feature] 这个仓库没人维护了吗? HOT 1
- Quick run[Docs]
- How to set manual seed
- [Bug] GPU OOM when running BasicVSR model using MMagicInferencer
- ERROR: Could not find a version that satisfies the requirement diffusers>=0.23.0 (from mmagic) (from versions: 0.0.1, 0.0.2, 0.0.3, 0.0.4, 0.1.0, 0.1.1, 0.1.2, 0.1.3, 0.2.0, 0.2.1, 0.2.2, 0.2.3, 0.2.4, 0.3.0, 0.4.0, 0.4.1, 0.4.2, 0.5.0, 0.5.1, 0.6.0, 0.7.0, 0.7.1, 0.7.2, 0.8.0, 0.8.1, 0.9.0, 0.10.0, 0.10.1, 0.10.2, 0.11.0, 0.11.1, 0.12.0, 0.12.1, 0.13.0, 0.13.1, 0.14.0, 0.15.0, 0.15.1, 0.16.0, 0.16.1, 0.17.0, 0.17.1, 0.18.0, 0.18.1, 0.18.2, 0.19.0, 0.19.1, 0.19.2, 0.19.3, 0.20.0, 0.20.1, 0.20.2, 0.21.0, 0.21.1, 0.21.2, 0.21.3, 0.21.4) ERROR: No matching distribution found for diffusers>=0.23.0
- [Bug] MMCV-Full required but failed installation HOT 1
- [Docs] A100算力加持!书生大模型实战营第3期全面升级,趣味闯关模式等你开启
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 mmagic.