I want to load my own data instead of mnist data

i want to load my own data instead of mnist data. How do I fix the code?

os.makedirs("…/…/data/mnist", exist_ok=True)
dataloader = torch.utils.data.DataLoader(
datasets.MNIST(
“…/…/data/mnist”,
train=True,
download=True,
transform=transforms.Compose(
[transforms.Resize(opt.img_size), transforms.ToTensor(), transforms.Normalize([0.5], [0.5])]
),
),
batch_size=opt.batch_size,
shuffle=True,
)

MNIST expects a specific format, so you would need to store your data in the same format and name accordingly.
The usual approach would be to e.g. use ImageFolder, if you are loading single image files, or a custom Dataset.
What kind of data do you have?

I converted my dataset to ‘idx3 uyte’ which is the same format as the mnist dataset. But I don’t know to how the data load. Thank you for your answer.

What kind of data do you have? Is it a binary blob?
How large is each sample?

My data is grayscale x-ray image data. Train data is 12920 KB, test data is 685 KB, train label data is 3 KB and test label data is 1 KB.

Did you store the x-ray images in some kind of binary data or do you have each image stored separately?
In the latter case, have a look at the Data Loading Tutorial to see how to create a custom Dataset.

I converted data from this url. (https://github.com/Arlen0615/Convert-own-data-to-MNIST-format/blob/master/convert_to_mnist_format.py)
Is this the case for the latter?

What if I want to upload my multidimensional data (1335x11 and .csv format) instead of MNSIT data?
How to approach with that?