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

Multiple .h5 training files #29

Open
DanChen001 opened this issue Nov 6, 2018 · 2 comments
Open

Multiple .h5 training files #29

DanChen001 opened this issue Nov 6, 2018 · 2 comments

Comments

@DanChen001
Copy link

Hi, dear Jiu, thank you for sharing the code.

Can I use multiple .h5 files to train the network? Since a single .h5 is too large to save. For caffe, we can generate multiple .h5 files to save training simples. How about pytorch? Could you give me some suggestions?

Thanks.

@twtygqyy
Copy link
Owner

twtygqyy commented Nov 8, 2018

Hi @DanChen001 , for training with multiple h5 files, I think you need to modify the data generator. You can allocate memory to a certain number of patches in the initialization stage, then load images from multiple h5 files into the allocated memory repeatedly.
Let's say you have 10 h5 files and each contain 1000 images, and you create an array for 1000 images in the beginning. If you batch size is 50, then after 20 iterations, your data generator will load another h5 file into the memory, copy the images into the array, and continue the training. You can also shuffle the data every time you load the images.
I hope this will help you to implement your own data generator.

@DanChen001
Copy link
Author

Hi @twtygqyy Sorry for the late reply. Thank you for helpful suggestions.

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