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

feat: Add custom data generator #6

Merged
merged 2 commits into from Mar 5, 2024

Conversation

Korred
Copy link
Owner

@Korred Korred commented Mar 5, 2024

  • created a keras Sequence based data generator that is used during model fit to provide the model with batches of data

  • added some image utils for:

    • parsing a directory to extract Image-Mask pairs (paths) that will be used by the generator to load the data
    • splitting a greyscale mask into n classes e.g. (256,256,1) with grayscale values (0...255) into (256,256,n) binary (0,1) filters
    • reverse operation to join the (256,256,n) binary mask back into the (256,256,1) mask with grayscale values
  • added pillow (PIL) to modules

  • created different conda environment files for Windows and WSL

    • environment-win holds a working env with Tensorflow 2.15 but only with CPU support (as GPU on bare Windows is not supported anymore)
    • environment-wsl holds a working env for WSL Ubuntu with Tensorflow 2.13 with GPU support (as installing 2.15 with "tensorflow[and-cuda]" on WSL has issues with registering cuDNN, cuFFT, cuBLAS and the GPU is sometimes not being found - cuDNN, cuFFT, and cuBLAS Errors tensorflow/tensorflow#62075)
  • a Tensorflow 2.13 trained model can still be used on a Windows machine with Tensorflow 2.15 (only when you save the model as a .h5 file instead of .keras)

…nd wsl

- "environment-win" holds a working env with Tensorflow 2.15 but only with CPU support (as GPU on bare Windows is not supported anymore)
- "environment-wsl" holds a working env for WSL Ubuntu with Tensorflow 2.13 with GPU support (as installing 2.15 with "tensorflow[and-cuda]" on WSL has issues with registering cuDNN, cuFFT, cuBLAS and the GPU is sometimes not being found - tensorflow/tensorflow#62075)
- a 2.13 trained model can still be used on a Windows machine with Tensorflow 2.15 (only when you save the model as a .h5 file instead of .keras)
- created a keras Sequence based data generator that is used during model fit to provide the model with batches of data
- added some image utils for:
  - parsing a directory to extract Image-Mask pairs (paths) that will be used by the generator to load the data
  - splitting a greyscale mask into n classes e.g. (256,256,1) with grayscale values (0...255) into (256,256,n) binary (0,1) filters
  - reverse operation to join the (256,256,n) binary mask back into the (256,256,1) mask with grayscale values
@Korred Korred requested a review from Katarzyna67 March 5, 2024 21:32
@Korred Korred self-assigned this Mar 5, 2024
@Korred Korred force-pushed the feature/add-custom-data-generator branch from 079ed58 to 7add96d Compare March 5, 2024 21:32
Copy link
Collaborator

@Katarzyna67 Katarzyna67 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@Katarzyna67 Katarzyna67 merged commit a01e005 into main Mar 5, 2024
@Korred Korred deleted the feature/add-custom-data-generator branch March 15, 2024 14:30
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

Successfully merging this pull request may close these issues.

None yet

2 participants