spmallick / learnopencv

Learn OpenCV : C++ and Python Examples
https://www.learnopencv.com/
20.68k stars 11.52k forks source link

Performance issues about tf.function #806

Open DLPerf opened 1 year ago

DLPerf commented 1 year ago

Hello! Our static bug checker has found a performance issue in Image-to-Image-Translation-with-GAN/TensorFlow/pix2pix-tensorflow-single_gpu.py: Python type argument epoch is passed to tf.function decorated function train_step instead of tensors. As there is a for loop, every time the value changes, a new graph will be generated, and that can trigger tf.function retracing warning.

Similar problem in Image-to-Image-Translation-with-GAN/TensorFlow/.ipynb_checkpoints/pix2pix-tensorflow-single_gpu-checkpoint.py

Here is the tensorflow document to support it.

Looking forward to your reply.

DLPerf commented 1 year ago

We are investigating this kind of issues, and your answer will be of great help to our work. Can you take a look? Thank you in advance! @Dovyski @zubairahmed-ai @najlepsiwebdesigner