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)
- [Feature] PowerPaint training code
- [Bug] Error when running PowerPaint: Entry Not Found for facenet.pth URL HOT 2
- [Bug] Invalid 'input_ids' in position:0 to 75.Expect'[49428,49429,49430,49431,49432,49433,49434,49435,49436,49437] for embedding 'P_obj' but found '[49428,49407]'
- [Feature] Give model different intialization
- [Bug] removal inpainting still include remnants of people HOT 1
- PowerPaint Windows MMCV Error
- PowerPaint Windows MMCV Error?
- [Bug] NSFW Error
- [Bug] no file of configs/animatediff/animatediff.py HOT 2
- [Bug] RealBasic got killed when loading model
- [Docs] The link MMEditing in the README redirects back to the same mmagic page
- [Bug] cyclegan:UnboundLocalError: local variable 'init_info' referenced before assignment HOT 2
- No module named 'diffusers.pipelines.controlnet_xs' HOT 9
- [Feature] The code and documentation are really terrible[Docs] HOT 1
- [Bug] - ImportError: /opt/conda/envs/mmagic/lib/python3.9/site-packages/mmcv/_ext.cpython-39-x86_64-linux-gnu.so: undefined symbol: _ZN3c105ErrorC2ENS_14SourceLocationESs
- [Docs] BasicVSR++ HOT 1
- 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
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.