Possible error when installing pytorch-cpu via conda

Hi,

when I issue the command, as listed on the website:

conda install pytorch-cpu torchvision -c pytorch

I would expect the package pytorch and all the cuda dependencies to NOT be installed. However, they are being installed, pytorch cuda and all the other larger packages:

341.21s$ conda install -c pytorch pytorch-cpu torchvision
Solving environment: done
## Package Plan ##
  environment location: /home/travis/build/TwentyBN/tyqoon/miniconda
  added / updated specs: 
    - pytorch-cpu
    - torchvision
The following packages will be downloaded:
    package                    |            build
    ---------------------------|-----------------
    numpy-1.14.2               |   py36hdbf6ddf_0         4.0 MB
    libgfortran-ng-7.2.0       |       hdf63c60_3         1.2 MB
    jpeg-9b                    |       h024ee3a_2         248 KB
    olefile-0.45.1             |           py36_0          47 KB
    pytorch-0.3.1              |py36_cuda8.0.61_cudnn7.0.5_2       205.1 MB  pytorch
    libpng-1.6.34              |       hb9fc6fc_0         334 KB
    pillow-5.0.0               |   py36h3deb7b8_0         561 KB
    mkl-2018.0.1               |       h19d6760_4       184.7 MB
    pytorch-cpu-0.3.1          |       py36_cpu_2        36.6 MB  pytorch
    freetype-2.8               |       hab7d2ae_1         804 KB
    torchvision-0.2.0          |   py36h17b6947_1         102 KB  pytorch
    intel-openmp-2018.0.0      |       hc7b2577_8         618 KB
    cudnn-7.0.5                |        cuda8.0_0       249.3 MB
    libtiff-4.0.9              |       h28f6b97_0         586 KB
    cudatoolkit-8.0            |                3       322.4 MB
    ------------------------------------------------------------
                                           Total:      1006.5 MB
The following NEW packages will be INSTALLED:
    cudatoolkit:    8.0-3                                     
    cudnn:          7.0.5-cuda8.0_0                           
    freetype:       2.8-hab7d2ae_1                            
    intel-openmp:   2018.0.0-hc7b2577_8                       
    jpeg:           9b-h024ee3a_2                             
    libgfortran-ng: 7.2.0-hdf63c60_3                          
    libpng:         1.6.34-hb9fc6fc_0                         
    libtiff:        4.0.9-h28f6b97_0                          
    mkl:            2018.0.1-h19d6760_4                       
    numpy:          1.14.2-py36hdbf6ddf_0                     
    olefile:        0.45.1-py36_0                             
    pillow:         5.0.0-py36h3deb7b8_0                      
    pytorch:        0.3.1-py36_cuda8.0.61_cudnn7.0.5_2 pytorch
    pytorch-cpu:    0.3.1-py36_cpu_2                   pytorch
    torchvision:    0.2.0-py36h17b6947_1               pytorch

I think this is due to the torchvision package requiring pytorch.

Also, does anyone know where the conda build files for the packages are located? I looked in the pytorch github but was unable to find anything.

pytorch-cpu depends on pytorch

But try this…

  1. uninstall pytorch and pytorch-cpu
  2. install pytorch
  3. record the disk usage of the site_packages directory
  4. install pytorch-cpu as well
  5. check the disk usage of the site_packages directory again - it will be lower than before

Basically, installing pytorch-cpu on top of pytorch removes some stuff from the full installation.

@jpeg729 actually, this is not correct. torchvision depends on pytorch. pytorch-cpu doesn’t depend on pytorch.

The conda recpie is here:

Also, you can see this bellow, where I first install pytorch-cpu and then torchvision using the -no-deps flag to ignore dependencies. As you can see, the cuda packages are not installed. This is the current workaround we us to avoid having to install the cuda packages on every run of our continuous integration system.

I took the liberty to propose a fix via pull-request:

esc@omnitech /tmp % conda install -c pytorch pytorch-cpu
Solving environment: done

## Package Plan ##

  environment location: /tmp/miniconda

  added / updated specs: 
    - pytorch-cpu


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    mkl-2018.0.1               |       h19d6760_4       184.7 MB  defaults
    intel-openmp-2018.0.0      |       hc7b2577_8         618 KB  defaults
    pytorch-cpu-0.3.1          |       py36_cpu_2        36.6 MB  pytorch
    libgfortran-ng-7.2.0       |       hdf63c60_3         1.2 MB  defaults
    numpy-1.14.2               |   py36hdbf6ddf_0         4.0 MB  defaults
    ------------------------------------------------------------
                                           Total:       227.1 MB

The following NEW packages will be INSTALLED:

    intel-openmp:   2018.0.0-hc7b2577_8   defaults
    libgfortran-ng: 7.2.0-hdf63c60_3      defaults
    mkl:            2018.0.1-h19d6760_4   defaults
    numpy:          1.14.2-py36hdbf6ddf_0 defaults
    pytorch-cpu:    0.3.1-py36_cpu_2      pytorch 


Downloading and Extracting Packages
mkl 2018.0.1: ###################################################################################################################################################################################################### | 100% 
intel-openmp 2018.0.0: ############################################################################################################################################################################################# | 100% 
pytorch-cpu 0.3.1: ################################################################################################################################################################################################# | 100% 
libgfortran-ng 7.2.0: ############################################################################################################################################################################################## | 100% 
numpy 1.14.2: ###################################################################################################################################################################################################### | 100% 
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
conda install -c pytorch pytorch-cpu  96,83s user 5,34s system 58% cpu 2:55,52 total
esc@omnitech /tmp % conda install --no-deps -c pytorch torchvision
Solving environment: done

## Package Plan ##

  environment location: /tmp/miniconda

  added / updated specs: 
    - torchvision


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    torchvision-0.2.0          |   py36h17b6947_1         102 KB  pytorch

The following NEW packages will be INSTALLED:

    torchvision: 0.2.0-py36h17b6947_1 pytorch


Downloading and Extracting Packages
torchvision 0.2.0: ################################################################################################################################################################################################# | 100% 
Preparing transaction: done
Verifying transaction: done
Executing transaction: done

I stand corrected.

If my memory serves me correctly, pytorch-cpu used to depend on pytorch in version 0.3.0, but maybe I am mistaken.

You could pickaxe your way through the git history, if you really want to know.

I found the pytorch-cpu-0.3.0 recipe:

Interestingly all old recipes are kept in an old subdirectory.