znxlwm / pytorch-generative-model-collections

Collection of generative models in Pytorch version.
2.59k stars 546 forks source link

How to use my own dataset #18

Open hanshuai119 opened 5 years ago

ArghyaPal commented 5 years ago

Hi,

open the dataloader.py file and, add

elif dataset == 'AWA': data_loader = DataLoader( datasets.ImageFolder('data/AWA', transform=transform), batch_size=batch_size, shuffle=True)

then, open main.py and modify this line: parser.add_argument('--dataset', type=str, default='mnist', choices=[ 'mnist', 'fashion-mnist', 'cifar10', 'cifar100', 'svhn', 'stl10', 'lsun-bed'],

to, parser.add_argument('--dataset', type=str, default='mnist', choices=['AWA', 'mnist', 'fashion-mnist', 'cifar10', 'cifar100', 'svhn', 'stl10', 'lsun-bed'],

HamzahNizami commented 5 years ago

Do the images have to be in a specific format or size. Thanks in advance

HamzahNizami commented 5 years ago

Hi,

open the dataloader.py file and, add

elif dataset == 'AWA': data_loader = DataLoader( datasets.ImageFolder('data/AWA', transform=transform), batch_size=batch_size, shuffle=True)

then, open main.py and modify this line: parser.add_argument('--dataset', type=str, default='mnist', choices=[ 'mnist', 'fashion-mnist', 'cifar10', 'cifar100', 'svhn', 'stl10', 'lsun-bed'],

to, parser.add_argument('--dataset', type=str, default='mnist', choices=['AWA', 'mnist', 'fashion-mnist', 'cifar10', 'cifar100', 'svhn', 'stl10', 'lsun-bed'],

Do the images have to be in a specific format or size. Thanks in advance

ArghyaPal commented 5 years ago

No, I don't think so. Please go ahead and use your dataset.. please reply back, if you encounter any problem related to image size

HamzahNizami commented 5 years ago

Okay I will try soon.

I have a dataset of my own JPG images. These images are of strawberries. The image I want to generate is of strawberries.

My images are in colour, will this affect training on this GitHub. Do I need to change to gray-scale.

Finally @ArghyaPal have you successfully trained this model on your dataset? Any help would be greatly appreciated.

Thanks in advance!

HamzahNizami commented 5 years ago

No, I don't think so. Please go ahead and use your dataset.. please reply back, if you encounter any problem related to image size

@ArghyaPal

Hi, I'm currently getting the following error.

image

Even though my images are jpg as shown in the image below. Any help would be appreicated.

image

HamzahNizami commented 5 years ago

I managed to fix this issue by placing them in another folder called 1, so my directory is now, data/strawberriesBlack/1/B(1).jpg

However, my results are completely blank after 50 epochs on GAN

image

My dataset is currently coloured, do you think I should change to grayscale? How big should said dataset actually be?

Thanks in advance

evdelph commented 4 years ago

@ArghyaPal I am having issues with either size or color scaling with these models, . I am trying to run color images of ships through GAN but I get shape errors (see issue 25). Is there a fix to this?