TypeError: 'FilesIndex' object is not iterable
Screenium opened this issue · 3 comments
The code is from the tutorial 1.
Traceback (most recent call last):
File "C:/Users/Predator/Documents/WORK/Project_CT/radio/radio_tut1.py", line 17, in
batch = (luna_dataset >> preprocessing).next_batch(batch_size=2, shuffle=False) # execution starts when you call next_batch
File "C:\Users\Predator\AppData\Local\Programs\Python\Python35\lib\site-packages\dataset\pipeline.py", line 1080, in next_batch
batch_res = next(self._batch_generator)
File "C:\Users\Predator\AppData\Local\Programs\Python\Python35\lib\site-packages\dataset\pipeline.py", line 1053, in gen_batch
batch_res = self.execute_for(batch)
File "C:\Users\Predator\AppData\Local\Programs\Python\Python35\lib\site-packages\dataset\pipeline.py", line 597, in execute_for
batch_res = self._exec_all_actions(batch)
File "C:\Users\Predator\AppData\Local\Programs\Python\Python35\lib\site-packages\dataset\pipeline.py", line 569, in _exec_all_actions
batch = self._exec_one_action(batch, _action, _action_args, _action['kwargs'])
File "C:\Users\Predator\AppData\Local\Programs\Python\Python35\lib\site-packages\dataset\pipeline.py", line 517, in _exec_one_action
batch = action_method(*args, **kwargs)
File "C:\Users\Predator\Documents\WORK\Project_CT\radio\radio\dataset\dataset\decorators.py", line 37, in _action_wrapper
_res = action_method(action_self, *args, **kwargs)
File "C:\Users\Predator\Documents\WORK\Project_CT\radio\radio\preprocessing\ct_batch.py", line 367, in load
self._load_raw() # pylint: disable=no-value-for-parameter
File "C:\Users\Predator\Documents\WORK\Project_CT\radio\radio\preprocessing\ct_batch.py", line 541, in _load_raw
for patient_id in self.indices:
TypeError: 'FilesIndex' object is not iterable
Hey, @Screenium!
The issue looks familiar. Though, for better understanding, I would like to see the content of your Dataset
-index. So, I suggest you run the following line (before calling next_batch
):
luna_index.indices[:5]
and share the results with us.
Thanks for reporting this and other issues, truly appreciated.
Best,
Alex.
Hello, I switched to mac but still having this issue. I put the line before calling next_batch as suggested.
Here is the result:
['1.3.6.1.4.1.14519.5.2.1.6279.6001.105756658031515062000744821260'
'1.3.6.1.4.1.14519.5.2.1.6279.6001.108197895896446896160048741492'
'1.3.6.1.4.1.14519.5.2.1.6279.6001.117383608379722740629083782428'
'1.3.6.1.4.1.14519.5.2.1.6279.6001.124663713663969377020085460568'
'1.3.6.1.4.1.14519.5.2.1.6279.6001.126121460017257137098781143514']
Traceback (most recent call last):
File "/Users/Welcome/Documents/work/radio/radio_tut1.py", line 19, in <module>
batch = (luna_dataset >> preprocessing).next_batch(batch_size=2, shuffle=False) # execution starts when you call next_batch
File "/usr/local/lib/python3.6/site-packages/dataset/pipeline.py", line 1080, in next_batch
batch_res = next(self._batch_generator)
File "/usr/local/lib/python3.6/site-packages/dataset/pipeline.py", line 1053, in gen_batch
batch_res = self.execute_for(batch)
File "/usr/local/lib/python3.6/site-packages/dataset/pipeline.py", line 597, in execute_for
batch_res = self._exec_all_actions(batch)
File "/usr/local/lib/python3.6/site-packages/dataset/pipeline.py", line 569, in _exec_all_actions
batch = self._exec_one_action(batch, _action, _action_args, _action['kwargs'])
File "/usr/local/lib/python3.6/site-packages/dataset/pipeline.py", line 517, in _exec_one_action
batch = action_method(*args, **kwargs)
File "/Users/Welcome/Documents/work/radio/radio/dataset/dataset/decorators.py", line 37, in _action_wrapper
_res = action_method(action_self, *args, **kwargs)
File "/Users/Welcome/Documents/work/radio/radio/preprocessing/ct_batch.py", line 367, in load
self._load_raw() # pylint: disable=no-value-for-parameter
File "/Users/Welcome/Documents/work/radio/radio/preprocessing/ct_batch.py", line 541, in _load_raw
for patient_id in self.indices:
TypeError: 'FilesIndex' object is not iterable
Process finished with exit code 1
Closing as non-active for a long time.
Feel free to reopen if the problem persists.