radio icon indicating copy to clipboard operation
radio copied to clipboard

TypeError: only integer scalar arrays can be converted to a scalar index

Open glescki opened this issue 4 years ago • 3 comments

Hi,

I'm following the first tutorial (RadIO.I.ipynb) and I always seem to get the same error. I've tryed with different data than from the Luna dataset and I get the same error.

After running this line:

batch = (luna_dataset >> preprocessing).next_batch(batch_size=3, shuffle=False)  # execution starts when you call next_batch

I get:

---------------------------------------------------------------------------

TypeError                                 Traceback (most recent call last)

<ipython-input-14-2649f0c8a285> in <module>()
----> 1 batch = (luna_dataset >> preprocessing).next_batch(batch_size=3, shuffle=False)  # execution starts when you call next_batch

6 frames

/usr/local/lib/python3.6/dist-packages/radio/batchflow/batchflow/dsindex.py in subset_by_pos(self, pos)
     84     def subset_by_pos(self, pos):
     85         """ Return subset of index by given positions in the index. """
---> 86         return self.index[pos]
     87 
     88     def create_subset(self, index):

TypeError: only integer scalar arrays can be converted to a scalar index

I'm running the notebook on google colab, but I also get the same error when running in my laptop.

What I am doing wrong here?

glescki avatar Dec 20 '19 15:12 glescki

Same error, different dataset.

isukrit avatar Jan 28 '20 07:01 isukrit

@AlexeyKozhevin @akoryagin Guys, please, comment

roman-kh avatar Jan 29 '20 11:01 roman-kh

Could you print pos and self.index in subset_by_pos method?

AlexeyKozhevin avatar Feb 06 '20 14:02 AlexeyKozhevin