Graph-COM / GSAT

[ICML 2022] Graph Stochastic Attention (GSAT) for interpretable and generalizable graph learning.
https://arxiv.org/abs/2201.12987
MIT License
162 stars 21 forks source link

ERROR when generating MNIST-75sp #11

Closed Esperanto-mega closed 1 year ago

Esperanto-mega commented 1 year ago

I am trying to generate the mnist75 dataset by running: ./scripts/prepare_data.sh and I am getting the following stacktrace: Fr Dez 16 17:57:00 CET 2022 start time: 2022-12-16 17:57:01.936994 dataset mnist data_dir ./data out_dir ./data split train threads 0 n_sp 75 compactness 0.25 seed 111 /home/mada/anaconda3/lib/python3.9/site-packages/skimage/_shared/utils.py:338: FutureWarning: multichannel is a deprecated argument name for slic. It will be removed in version 1.0. Please use channel_axis instead. warnings.warn(self.warning_msg.format( Traceback (most recent call last): File "graph_attention_pool/extract_superpixels.py", line 128, in sp_data.append(process_image((images[i], i, n_images, args, True, True))) File "graph_attention_pool/extract_superpixels.py", line 55, in process_image assert n_sp_extracted == np.max(superpixels) + 1, ('superpixel indices', np.unique(superpixels)) # make sure superpixel indices are numbers from 0 to n-1 AssertionError: ('superpixel indices', array([ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71]))

Do you know what the issue might be?

Thank you in advance!

Esperanto-mega commented 1 year ago

Solution: Modify the code in line 55.

assert n_sp_extracted == np.max(superpixels), ('superpixel indices', np.unique(superpixels))