UChicago-Thinking-Deep-Learning-Course / Frequently-Asked-Questions

Use this repository to post questions regarding homework or course organisation.
0 stars 0 forks source link

Homework 3.2 loading data in main function of Minibatch SGD #5

Open william-wei-zhu opened 3 years ago

william-wei-zhu commented 3 years ago

Hi Bhargav and Likun,

I am having trouble loading in my own data for Homework 3.2, Minibatch stochastic gradient descent (SGD). In the sample code you provided in the notebook, MNIST data is loaded in the main function using the following code:

train_loader = torch.utils.data.DataLoader(datasets.MNIST('../data', train=True, download=True, transform=transform),train_kwargs) test_loader = torch.utils.data.DataLoader(datasets.MNIST('../data', train=False, transform=transform), test_kwargs)

I tried replacing "datasets.MNIST('../data', train=True, download=True, transform=transform)" with my own dataset (train_data and test_data) , which leads to error. Can you give me a sample code of loading my own data into the main function? What parameters do I need to change?

Thank you!

bhargavvader commented 3 years ago

Hey @william-wei-zhu , did you manage to fix this with using your own image dataset, or did you use Keras?