omoindrot / tensorflow-triplet-loss

Implementation of triplet loss in TensorFlow
https://omoindrot.github.io/triplet-loss
MIT License
1.12k stars 283 forks source link

Performance issues in the program #60

Open DLPerf opened 3 years ago

DLPerf commented 3 years ago

Hello,I found a performance issue in the definition of dataset , omoindrot/tensorflow-triplet-loss/blob/master/model/mnist_dataset.py, images = images.map(decode_image) was called without num_parallel_calls. I think it will increase the efficiency of your program if you add this.

The same issues also exist in labels = tf.data.FixedLengthRecordDataset(labels_file, 1, header_bytes=8).map(decode_label)

Here is the documemtation of tensorflow to support this thing.

Looking forward to your reply. Btw, I am very glad to create a PR to fix it if you are too busy.