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

Fix augmentations and matplotlib #1179

Merged

Conversation

DocGarbanzo
Copy link
Contributor

@DocGarbanzo DocGarbanzo commented May 21, 2024

Fix recent compatibility issues with augmentations and matplotlib

* replacye spurios __file__ in load_config with os.getcwd()
* pin matplotlib versions to 3.8.*
* fix log statement in training
@DocGarbanzo DocGarbanzo requested a review from Ezward May 21, 2024 21:14
@@ -153,7 +153,7 @@ def train(cfg: Config, tub_paths: str, model: str = None,
assert val_size > 0, "Not enough validation data, decrease the batch " \
"size or add more data."
logger.info(f'Train with image caching: '
f'{getattr(cfg, "CACHE_IMAGES", True)}')
f'{getattr(cfg, "CACHE_IMAGES", "ARRAY")}')
Copy link
Contributor

Choose a reason for hiding this comment

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

@DocGarbanzo I don't know that this means. Does this limit the size of the cache?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In the previous PR, we have upgraded the CACHE_IMAGES config parameter to allow for 3 values, i.e NOCACHE, ARRAY and BINARY, please see here: https://github.com/autorope/donkeycar/pull/1173/files#diff-8a130617f883f549bf089e3ab0c46cabd4c3e4a69b50568c3b27ef73414e7c28. ARRAY represents the original setting where the whole image is cached as a np.uint8 array (consuming about 58k of mem ~ 120 * 160 * 3). With BINARY we can now cache the image as binary jpeg encoded which uses only 4k of memory. This caching still provides significantly faster access to the image than re-reading it from disk, even with a fast M2 SSD. With that much smaller memory footprint we can now train >> 100k images with caching, speeding up the training on large datasets by a lot. In this line here, I just fixed a left-over from the previous PR and here, it only affects logging the caching status into the shell, because the default changed from the binary True to the enum/string 'ARRAY'.

Copy link
Contributor

@Ezward Ezward left a comment

Choose a reason for hiding this comment

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

I have one question; see the comment.

…d not 'arm64' which is what Apple Silicon is now reporting.
@Ezward Ezward self-requested a review May 25, 2024 18:27
Copy link
Contributor

@Ezward Ezward left a comment

Choose a reason for hiding this comment

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

Thanks for this.

@DocGarbanzo DocGarbanzo merged commit 8b96b7a into autorope:main May 25, 2024
3 checks passed
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.

2 participants