def __getitem__(self, index):
t1_path, ir_path, flair_path, seg_path = self.list[index]
t1_data, ir_data, flair_data, seg_data = np.load(t1_path), np.load(ir_path), np.load(flair_path), np.load(
seg_path)
return torch.FloatTensor(t1_data.copy()).unsqueeze(0), torch.FloatTensor(ir_data.copy()).unsqueeze(0), \
torch.FloatTensor(flair_data.copy()).unsqueeze(0), torch.FloatTensor(seg_data.copy())
After replacing the getitem method in line 77 of the file lib->medloaders>mrbrains2018.py with the following code, the error disappears and the training can proceed normally.