I converted all the train and test images using both opencv and PIL
This is PIL code
for F in os.listdir(directory):
        img=Image.open(directory+'/'+'{}'.format(F))
        img=img.resize((64,64))
        img=img.convert('LA')
        name=F.split('.')[1]
        img.save(final_url+'/'+'{}.jpg'.format(name))

This is opencv code for converting all images to gray scale and saving it to a directory,
for F in os.listdir(directory):
        img=cv2.imread(path)
        img=cv2.resize((64,64),img)
        img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
        name=F.split('.')[1]
        cv2.imwrite(final_url+'/'+'{}.jpg'.format(name))

class CNNModel(nn.Module):
    def __init__(self):
        super(CNNModel,self).__init__()
        #Convo 1
        self.cnn1=nn.Conv2d(in_channels=1,out_channels=16,kernel_size=5,stride=1,padding=2)
        self.relu1=nn.ReLU()
        #Maxpool_1
        self.maxpool1=nn.MaxPool2d(kernel_size=2)
        #Convo_2
        self.cnn2=nn.Conv2d(in_channels=16,out_channels=32,kernel_size=5,stride=1,padding=2)
        self.relu2=nn.ReLU()
        self.maxpool2=nn.MaxPool2d(kernel_size=2)
        self.fc1=nn.Linear(32*16*16,2)
    def forward(self,x):
        #Convo_1
        out=self.cnn1(x)
        out=self.relu1(out)
        #Max_pool1
        out=self.maxpool1(out)
        #Convo_2
        out=self.cnn2(out)
        out=self.relu2(out)
        out=self.maxpool2(out)
        out=out.view(out.size(0),-1)#Flattening out 
        out=self.fc1(out)
        return out

Iam getting this error,
RuntimeError: Given groups=1, weight[16, 1, 5, 5], so expected input[100, 3, 64, 64] to have 1 channels, but got 3 channels instead.
Information is less  in gray scale compared to RGB images,so I thought it would take lesser time.