I'm getting an error even though I'm using less data


ValueError Traceback (most recent call last)
in ()
81 if not modelfiles:
—> 82 modelfiles = [train_mri_type(df_train, df_valid, m) for m in mri_types]
83 print(modelfiles)

7 frames
/usr/local/lib/python3.7/dist-packages/torch/_utils.py in reraise(self)
423 # have message field
424 raise self.exc_type(message=msg)
→ 425 raise self.exc_type(msg)

ValueError: Caught ValueError in DataLoader worker process 2.
Original Traceback (most recent call last):
File “/usr/local/lib/python3.7/dist-packages/torch/utils/data/_utils/worker.py”, line 287, in _worker_loop
data = fetcher.fetch(index)
File “/usr/local/lib/python3.7/dist-packages/torch/utils/data/_utils/fetch.py”, line 44, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File “/usr/local/lib/python3.7/dist-packages/torch/utils/data/_utils/fetch.py”, line 44, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File “”, line 23, in getitem
data = load_dicom_images_3d(str(scan_id).zfill(5), mri_type=self.mri_type[index], split=“train”, rotate=rotation)
File “”, line 26, in load_dicom_images_3d
img3d = np.stack([load_dicom_image(f, rotate=rotate) for f in files[p1:p2]]).T
File “<array_function internals>”, line 6, in stack
File “/usr/local/lib/python3.7/dist-packages/numpy/core/shape_base.py”, line 423, in stack
raise ValueError(‘need at least one array to stack’)
ValueError: need at least one array to stack


I’m using this guy’s model, but when I do a train with googlecolab again, I get an Error.

What should I do?

By the way, the data is heavy, so I’ve reduced it to 1/20, but it doesn’t matter how much data I have.
Isn’t it too hard to use googlecolab?
If anyone has a cool answer, I’d appreciate it.

By the way,this plan is great because it is a 50$ plan.

The error is raised by np.stack if you try to pass an empty list to np.stack:

> ValueError: need at least one array to stack