MemoryError from sklearn.metrics.silhouette_samples

I get a memory error when trying to call sklearn.metrics.silhouette_samples. My use case is identical to this tutorial. I am using scikit-learn 0.18.1 in Python 3.5. For the related function,