Here is how I sorted my cuda version mismatch with torch and torchvision in Python2.7 through pip.
pip install torch==1.4.0+cu100 torchvision==0.5.0+cu100 -f https://download.pytorch.org/whl/torch_stable.html