You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello! I've found a performance issue in /tests/testdata/keras_tuner_cifar_example.py: batch() should be called before map(), which could make your program more efficient. Here is the tensorflow document to support it.
Detailed description is listed below:
.batch(BATCH_SIZE)(here) should be called before train_dataset.map(scale)(here).
.batch(BATCH_SIZE)(here) should be called before .map(scale)(here).
Besides, you need to check the function called in map()(e.g., scale called in .map(scale)) whether to be affected or not to make the changed code work properly. For example, if scale needs data with shape (x, y, z) as its input before fix, it would require data with shape (batch_size, x, y, z).
Looking forward to your reply. Btw, I am very glad to create a PR to fix it if you are too busy.
The text was updated successfully, but these errors were encountered:
I resolved the performance issue by changing the order of operations in the dataset pipeline, calling .batch(BATCH_SIZE) before .map(scale). This modification improves efficiency by batching the data before applying the map function, reducing the number of individual function calls.
Hello! I've found a performance issue in /tests/testdata/keras_tuner_cifar_example.py:
batch()
should be called beforemap()
, which could make your program more efficient. Here is the tensorflow document to support it.Detailed description is listed below:
.batch(BATCH_SIZE)
(here) should be called beforetrain_dataset.map(scale)
(here)..batch(BATCH_SIZE)
(here) should be called before.map(scale)
(here).Besides, you need to check the function called in
map()
(e.g.,scale
called in.map(scale)
) whether to be affected or not to make the changed code work properly. For example, ifscale
needs data with shape (x, y, z) as its input before fix, it would require data with shape (batch_size, x, y, z).Looking forward to your reply. Btw, I am very glad to create a PR to fix it if you are too busy.
The text was updated successfully, but these errors were encountered: