Whats wrong in my code?


import torch.optim as optim
import torch.utils.data as D
train=D.Dataset(f("train/scz"))
train2=D.Dataset(f("train/cont"))
train3=D.ConcatDataset([train,train2])

tnx
nate

Hi,
Please specify certain things like the errors you are facing, what’s f (Is it some function that you’ve defined or did you mean to use f strings) and so on.

1 Like

f is function that reads folder of nii.gz files and returns list of covariance between 64 variables for any of files (n6464)
p.s. this function using nilearn

‫בתאריך יום ב׳, 19 בספט׳ 2022 ב-17:07 מאת ‪Srishti Gureja via PyTorch Forums‬‏ <‪noreply@discuss.pytorch.org‬‏>:‬

Ok, thanks for answering. But, further you need to specify the errors you are facing.
Also, how are you using torch.utils.data.Dataset?

Generally, a custom Dataset class is implemented as a subclass of torch.utils.data.Dataset and its instances are used to create dataloader compatible objects.