Solved by Sahil_Goyal in post #2 
              
              
                Actually, it is related to the version of torchvision. Earlier I was using 0.8.0a0, changing to 0.9.0a0 resolved the issue