Update collect_env.py to detect relevant conda-installed numpy and cudatoolkit (#35646)
Summary:
Addresses a small issue noticed in gh-32369
With this PR in a clean conda env where `conda install pytorch torchvision cudatoolkit=10.1 -c pytorch` was run:
```
Versions of relevant libraries:
[pip] numpy==1.18.1
[pip] torch==1.4.0
[pip] torchvision==0.5.0
[conda] blas 1.0 mkl
[conda] cudatoolkit 10.1.243 h6bb024c_0
[conda] mkl 2020.0 166
[conda] mkl-service 2.3.0 py37he904b0f_0
[conda] mkl_fft 1.0.15 py37ha843d7b_0
[conda] mkl_random 1.1.0 py37hd6b4f25_0
[conda] numpy 1.18.1 py37h4f9e942_0
[conda] numpy-base 1.18.1 py37hde5b4d6_1
[conda] pytorch 1.4.0 py3.7_cuda10.1.243_cudnn7.6.3_0 pytorch
[conda] torchvision 0.5.0 py37_cu101 pytorch
```
With current master:
```
Versions of relevant libraries:
[pip] numpy==1.18.1
[pip] torch==1.4.0
[pip] torchvision==0.5.0
[conda] blas 1.0 mkl
[conda] mkl 2020.0 166
[conda] mkl-service 2.3.0 py37he904b0f_0
[conda] mkl_fft 1.0.15 py37ha843d7b_0
[conda] mkl_random 1.1.0 py37hd6b4f25_0
[conda] pytorch 1.4.0 py3.7_cuda10.1.243_cudnn7.6.3_0 pytorch
[conda] torchvision 0.5.0 py37_cu101 pytorch
```
Note that the conda output will always also include pip-installed packages, so there are still duplicates now. If it's desirable to completely remove the `pip list` output for conda envs, that's also an option.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/35646
Differential Revision: D20736304
Pulled By: zou3519
fbshipit-source-id: fb6b3da3f69395869bc8c52bf7a85e9d15b0476d