Hello,
I have been trying to load data one line at a time from two excel files into a dataloader since my files are larger than the RAM I have available. One file contains the data and the other one contains the labels and both are excel files.
I tried following examples such as the ones below, but to no avail. Can anyone please point out what I am doing wrong? Both files are in the “current working data” root folder.
Examples:
pyroomacoustics.readthedocs.io/en/pypi-release/pyroomacoustics.room.html
https://pytorch.org/tutorials/beginner/data_loading_tutorial.html
I get the following error:
File “C:\Users\johnt\anaconda3\lib\site-packages\torch\utils\data\dataloader.py”, line 1146, in _try_get_data
raise RuntimeError(f’DataLoader worker (pid(s) {pids_str}) exited unexpectedly’) from e
RuntimeError: DataLoader worker (pid(s) 113228, 108680, 109552, 119108, 117720, 116756, 114436, 68888) exited unexpectedly
My code is as follows:
class MyDataset(torch.utils.data.Dataset):
def __init__(self):
self.data_files = os.listdir('current working data')
def __getindex__(self, idx):
return torch.load(self.data_files[idx])
def __len__(self):
return len(self.data_files)
training_data = MyDataset()
train_loader = DataLoader(training_data, batch_size = batch_size, shuffle = False, num_workers=8)
Any help is greatly appreciated.
Thank you very much.