tensorlayer / TensorLayer

Deep Learning and Reinforcement Learning Library for Scientists and Engineers
http://tensorlayerx.com
Other
7.31k stars 1.61k forks source link

Performance issues in examples/ #1139

Open DLPerf opened 2 years ago

DLPerf commented 2 years ago

Hello! I've found a performance issue in tensorlayer/examples: 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:

Besides, you need to check the function called in map()(e.g., _map_fn called in dataset.map()) whether to be affected or not to make the changed code work properly. For example, if _map_fn 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.

zsdonghao commented 2 years ago

thanks, we will have a check asap

DLPerf commented 2 years ago

Hello, How long do you need to confirm this problem? @zsdonghao Thank you~

hanjr92 commented 2 years ago

Sorry! It is too late to reply you. I will modify them and update. @DLPerf