AttnGAN icon indicating copy to clipboard operation
AttnGAN copied to clipboard

One possible code error in `datasets.py`

Open mazm13 opened this issue 5 years ago • 1 comments

Codes in https://github.com/taoxugit/AttnGAN/blob/0d000e652b407e976cb88fab299e8566f3de8a37/code/datasets.py#L305 should be changed to sent_ix = random.randint(0, self.embeddings_num - 1) since sent_ix could be 10 when you invoke random.randint(0, 10), that is 1/11 probability loading wrong caption.

mazm13 avatar Oct 22 '19 07:10 mazm13

Hi guys, I made a mistake, the author import numpy.random as random at the beginning was neglected by me. The same mudule and function name in Python stardard library random misled me.

Sorry, the original code is right.

mazm13 avatar Nov 01 '19 08:11 mazm13