the size of output of the MatchingNetwork.encoder
hwijeen opened this issue · comments
Hi, thank you for a well-packed blog post and implementation on meta-learning!
I have a question about the implementation of the matching network.
I see that you don't resize Omniglot image, and let an example has a size of 105x105.
This results in the runtime error in the following line, because the input size of LSTM is 64,but the size of 'embedding' is 2304(after self.encoder). The size becomes 64 if the original image is resized to 28x28.
Line 69 in eab3c78
This implementation also resizes Omniglot into 28 * 28.
Do you not get this runtime error with the current version of the code? Should I resize image in this part?
Line 39 in eab3c78
In fact this implementation does resize the image however its done in a pre-processing step.
few-shot/scripts/prepare_omniglot.py
Line 37 in eab3c78
The
scripts/prepare_omniglot.py
script takes the zip files of the raw Omniglot dataset, resizes them to 28x28 and creates new classes by 90, 180 and 270 degree rotations as in the original research.The OmniglotDataset
class simply reads the pre-processed images. Did you use this script to perform the pre-processing?
A quick fix would be to add instance = skimage.transform.resize(instance, (28, 28), anti_aliasing=True))
to the __getitem__
method as you suggested.
I didn't run prepare_omniglot script. Thanks for your reply!