Course project doubt. I am stuck. HELP PLZ

I have created a Generative Adversarial Networks for my course project. Now, I am training it with actual human faces rather than anime faces. I have already trained my model to around 80 epochs with different hyperparameters but the generator loss doesn’t go below 5 and it’s not going down. After 80 epochs I am able to get this result:

Now, how should I proceed to get better results? Please tell

1 Like

@hemanth Sir, or anyone of my fellow learners, please help me out here. I am not any expert on neural networks especially the use of resnet and thus wanted to try it out the first time in my course project. I have been stuck on this for quite some time and I desperately need help with this.

This is the error I have been receiving.
I have followed this particular reference for my help and despite of following the exact steps after a while, its still showing the same error.

The link to my notebook is as follows:

It looks like the dimensions of the tensors are not matching for Linear Algebra to run it’s course- you skipped the data normalization and data augmentation step which would help make the tensors equivalent. Try the code in Lesson 5 for normalization and augmentation.

@mm19b043, thank you so much for replying. But can you please explain further. What part exactly have I missed out. I checked the lesson 5 notebook again but I do not see it. Please excuse my negligence and help me out. Thanks again.

# Data transforms (normalization & data augmentation)
stats = ((0.4914, 0.4822, 0.4465), (0.2023, 0.1994, 0.2010))
train_tfms = tt.Compose([tt.RandomCrop(32, padding=4, padding_mode='reflect'), 
                         tt.RandomHorizontalFlip(), 
                         # tt.RandomRotate
                         # tt.RandomResizedCrop(256, scale=(0.5,0.9), ratio=(1, 1)), 
                         # tt.ColorJitter(brightness=0.1, contrast=0.1, saturation=0.1, hue=0.1),
                         tt.ToTensor(), 
                         tt.Normalize(*stats,inplace=True)])
valid_tfms = tt.Compose([tt.ToTensor(), tt.Normalize(*stats)])

I hope this helps!

Hey dude, after a little bit of research, it looks like if you change the input in tt.RandomCrop() to anything other than 32- the error turns up. This is owing to how we’ve defined ResNet9() in lesson 5. If you wish to insert a higher quality/more dense image then you’ll have to change the ResNet architecture to fit the number of input channels you’re providing (you have to reach a single number at the end of this exercise so if you double the pixel density in the start-- you’ll have to add a layer on top of the existing CNN)

This should make it a little more explicit. There’s a separate thread for this particular discussion, head over there to get a better idea.