Closed Screenium closed 6 years ago
The code is from the tutorial 4
@Screenium
The error arises because of different default types of integer numbers in different operating systems. I guess you use Windows so faced that problem. We've already fixed it and will add in the following release. Now you can change function get_nodules_numba
in radio/preprocessing/ct_masked_batch.py
in the following way:
@njit(nogil=True)
def get_nodules_numba(data, positions, size):
size = size.astype(np.int64)
out_arr = np.zeros((positions.shape[0], size[0], size[1], size[2]))
n_positions = positions.shape[0]
for i in range(n_positions):
out_arr[i, :, :, :] = data[positions[i, 0]: positions[i, 0] + size[0],
positions[i, 1]: positions[i, 1] + size[1],
positions[i, 2]: positions[i, 2] + size[2]]
return out_arr.reshape(n_positions * size[0], size[1], size[2])
Best, Alexey
Thank you for answer. It did indeed help to move from the issue how ever my windows still freezes to death while running the pipeline. Switched to mac but following error has yielded :
Traceback (most recent call last):
File "/Users/Welcome/Documents/work/radio/radIO.py", line 82, in <module>
batch = combine_pipeline.next_batch()
File "/Users/Welcome/Documents/work/radio/radio/dataset/dataset/pipeline.py", line 1057, in next_batch
batch_res = self.next_batch(*self._lazy_run[0], **self._lazy_run[1])
File "/Users/Welcome/Documents/work/radio/radio/dataset/dataset/pipeline.py", line 1062, in next_batch
batch_res = next(self._batch_generator)
File "/Users/Welcome/Documents/work/radio/radio/dataset/dataset/pipeline.py", line 1033, in gen_batch
for batch in batch_generator:
File "/Users/Welcome/Documents/work/radio/radio/dataset/dataset/base.py", line 162, in gen_batch
for ix_batch in self.index.gen_batch(batch_size, shuffle, n_epochs, drop_last):
File "/Users/Welcome/Documents/work/radio/radio/dataset/dataset/dsindex.py", line 276, in gen_batch
batch = self.next_batch(batch_size, shuffle, n_epochs, drop_last, iter_params)
File "/Users/Welcome/Documents/work/radio/radio/dataset/dataset/dsindex.py", line 250, in next_batch
return self.create_batch(rest_items, pos=True)
File "/Users/Welcome/Documents/work/radio/radio/dataset/dataset/dsindex.py", line 292, in create_batch
batch = self.subset_by_pos(_batch_indices)
File "/Users/Welcome/Documents/work/radio/radio/dataset/dataset/dsindex.py", line 80, in subset_by_pos
return self.index[pos]
TypeError: only integer scalar arrays can be converted to a scalar index
Process finished with exit code 1
Closing as non-active for a long time. Feel free to reopen if the problem persists.
During handling of the above exception, another exception occurred:
The code above was tested on a very small dataset of pictures from LUNA16 dataset after 'lunaset.train >> crop_pipeline).run()' just freezes my PC for eternity testing on the whole dataset. Restarts even (after long time of being freezed). Running on win10 x64 with i7 processor.
Everything is up to date. Upgraded to newest numpy+mkl,numba,llvmlite. Running the python 3.5.
Any one experiencing the same problem?