Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Faster training compared to Monodepth2 #2

Open
F-Pizo opened this issue Jul 12, 2022 · 3 comments
Open

Faster training compared to Monodepth2 #2

F-Pizo opened this issue Jul 12, 2022 · 3 comments

Comments

@F-Pizo
Copy link

F-Pizo commented Jul 12, 2022

Hi and thanks for sharing your code online!

When training my own models and comparing with the Monodepth2 framework, I noticed that CADepth-Net takes significantly less time to train with all parameters being the same - number of layers, epochs, type of training data, hardware.
For example, 6h53m for 20 epochs on monocular data with ResNet18 for both depth and pose. My MonoDepth model with the same settings took 11h19m, consistently over several tests.
To my understanding, you essentially took the Monodepth2 code and then added the SPM and DEM, so I wonder how that results in reduced training time.
Do you have an idea why this might be?

@kamiLight
Copy link
Owner

For faster image preprocessing, we use opencv+albumentations instead of pil+ torchvision which Monodepth2 uses, you can see datasets/mono_dataset.py for more details. And you can see this experiments for speed comparison.

@F-Pizo
Copy link
Author

F-Pizo commented Jul 13, 2022

Thanks for the fast reply!
Since according to the link you shared, cv2.imread is a lot slower than PIL.Image.open, I suppose the main load during training comes from other things where albumentations gives a speed boost, like image flipping and other data augmentation stuff.
I have another question though:
My Monodepth2 model took 11h23 with ResNet50 and 11h19 with ResNet18 -- barely any difference.
CADepth-Net however took 10h11 with ResNet50 and 6h53 with ResNet18.
I wonder how one model is almost invariant to the encoder size and the other one not?

@kamiLight
Copy link
Owner

we haven't compared the training time between the MonoDepth2 and CADepth-Net with different encoder, but i think you can use some tools, like lineprofiler, to check the running speed for encoder, decoder and so on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants