3

I've been trying to use the following package and just when I tried to instantiate it, NotImplementedError: showed up in Google Colab.

Complete traceback of the issue

<ipython-input-51-9980be5d7f5b> in <module>()
      4 test_dataset = MyData(input_tensor_test, target_tensor_test)
      5 
----> 6 train_dataset = DataLoader(train_dataset, sampler=ImbalancedDatasetSampler(train_dataset),batch_size = BATCH_SIZE, 
      7                      drop_last=True
      8                      )

1 frames
/content/drive/My Drive/torchsampler/imbalanced.py in __init__(self, dataset, indices, num_samples, callback_get_label)
     30         label_to_count = {}
     31         for idx in self.indices:
---> 32             label = self._get_label(dataset, idx)
     33             if label in label_to_count:
     34                 label_to_count[label] += 1

/content/drive/My Drive/torchsampler/imbalanced.py in _get_label(self, dataset, idx)
     51             return self.callback_get_label(dataset, idx)
     52         else:
---> 53             raise NotImplementedError
     54 
     55     def __iter__(self):

NotImplementedError: 

I've seen similar solution to tackle this but it was in jupyter notebook where proposed solution consisted of upgrading the notebook.

How can I do it in Colab or is there any other alternate way to fix this issue on Colab?

0 Answers0