Commit ef285c19 authored by Andrei-Claudiu Roibu's avatar Andrei-Claudiu Roibu 🖥
Browse files

added torch import - fixed bug

parent 186328d1
......@@ -12,12 +12,12 @@ To use content from this folder, import the functions and instantiate them as yo
"""
import os
import h5py
from glob import glob
import numpy as np
import nibabel as nib
import torch
import torch.utils.data as data
def dirReader(folder_location):
......@@ -167,17 +167,19 @@ def get_datasets(data_parameters):
None
"""
training_data = h5py.Files(os.path.join(data_parameters['data_directory'], data_parameters['training_data']), 'r')
testing_data = h5py.Files(os.path.join(data_parameters['data_directory'], data_parameters['testing_data']), 'r')
training_data = h5py.File(os.path.join(data_parameters['data_directory'], data_parameters['training_data']), 'r')
testing_data = h5py.File(os.path.join(data_parameters['data_directory'], data_parameters['testing_data']), 'r')
training_labels = h5py.Files(os.path.join(data_parameters['data_directory'], data_parameters['training_targets']), 'r')
testing_labels = h5py.Files(os.path.join(data_parameters['data_directory'], data_parameters['testing_targets']), 'r')
training_labels = h5py.File(os.path.join(data_parameters['data_directory'], data_parameters['training_targets']), 'r')
testing_labels = h5py.File(os.path.join(data_parameters['data_directory'], data_parameters['testing_targets']), 'r')
return (
DataMapper(training_data['data'][()], training_labels['label'][()]),
DataMapper(testing_data['data'][()], testing_labels['label'][()])
)
if __name__ == "__main__":
folder_location = '/well/win-biobank/projects/imaging/data/data3/subjectsAll/'
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment