How can l uninstall PyTorch?

后端 未结 6 1095
走了就别回头了
走了就别回头了 2020-12-17 10:04

I can\'t find any command to uninstall and remove all PyTorch dependencies. Even on the pytorch.org website.

I installed PyTorch with

conda install p         


        
6条回答
  •  情深已故
    2020-12-17 10:22

    Perhaps @Schütze meant with "This does not remove all the files." that there are still files in the Anaconda\pkgs folder.

    Mind that you can remove the tar.b2 and the folder of the now unused packages in Anaconda\pkgs. I uninstalled pytorch cuda version (because my display driver does not support cuda) and there were huge files there:

    • pytorch-1.5.0-py3.7_cuda102_cudnn7_0.tar.bz2
    • pytorch-1.5.0-py3.7_cuda102_cudnn7_0
    • cudatoolkit-10.2.89-h74a9793_1.conda
    • cudatoolkit-10.2.89-h74a9793_1

    This makes 3 GB altogether! Either do this manually, or with a command:

    to delete all unneeded packages:

        conda clean --yes --packages --dry-run
    

    to delete all unneeded tar.bz2 / conda

        conda clean --yes --tarballs --dry-run
    

    to delete all together

        conda clean --yes --all --dry-run
    

    First use parameter --dry-run to see what will happen. Afterwards, run without --dry-run. This has cleaned about 3.5 GB of the used 7 GB disk space that was used by Anaconda\pkgs.

    References: How to uninstall all unused packages in a conda virtual environment? and Anaconda Python: Delete .tar.gz in pkgs

提交回复
热议问题