tristandeleu / ntm-one-shot

One-shot Learning with Memory-Augmented Neural Networks
MIT License
421 stars 94 forks source link

Issues with sample larger than population #17

Open salimoha opened 6 years ago

salimoha commented 6 years ago

I was trying to adapt your MANN code for detection of other types of images which are not black and white. During the training process, I get the error: raise ValueError("Sample larger than population or is negative")

Please advise. Thanks

tristandeleu commented 6 years ago

This error looks like a numpy error, and it's unclear where it could come from. If you want to adapt the code with RGB images, you can create a generator like OmniglotGenerator for your own dataset. The only thing to notice is that the images in an episode are flattened. You also have to change the input_size when you call the model to something like 20 * 20 * 3 if you have 20x20 RGB images (this is the size of each flattened image in an episode).