Adversarial-Deep-Learning / code-soup

This is a collection of algorithms and approaches used in the book adversarial deep learning
MIT License
18 stars 18 forks source link

Error when creating Conda environment on Linux #43

Closed gchhablani closed 3 years ago

gchhablani commented 3 years ago

Problem

An error occurs when I attempt to create conda environment in Linux (Ubuntu 20.04). This is a known issue.

The reason this happens is because @blackrosedragon2 created the environment on his Windows machine and some packages may not be available for other platforms.

Here is the yaml I get when I export the environment after installing with requirements.txt:

name: adl_env
channels:
  - defaults
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=4.5=1_gnu
  - ca-certificates=2021.7.5=h06a4308_1
  - certifi=2021.5.30=py38h06a4308_0
  - ld_impl_linux-64=2.35.1=h7274673_9
  - libffi=3.3=he6710b0_2
  - libgcc-ng=9.3.0=h5101ec6_17
  - libgomp=9.3.0=h5101ec6_17
  - libstdcxx-ng=9.3.0=hd4cf53a_17
  - ncurses=6.2=he6710b0_1
  - openssl=1.1.1k=h27cfd23_0
  - pip=21.2.2=py38h06a4308_0
  - python=3.8.11=h12debd9_0_cpython
  - readline=8.1=h27cfd23_0
  - setuptools=52.0.0=py38h06a4308_0
  - sqlite=3.36.0=hc218d9a_0
  - tk=8.6.10=hbc83047_0
  - wheel=0.36.2=pyhd3eb1b0_0
  - xz=5.2.5=h7b6447c_0
  - zlib=1.2.11=h7b6447c_3
  - pip:
    - numpy==1.21.1
    - pillow==8.3.1
    - torch==1.9.0
    - torchvision==0.10.0
prefix: /home/crocoder/anaconda3/envs/adl_env

Just to compare, here is the current environment.yml:

name: adversarialDl
channels:
  - pytorch
  - defaults
dependencies:
  - blas=1.0=mkl
  - ca-certificates=2021.7.5=haa95532_1
  - certifi=2021.5.30=py38haa95532_0
  - cudatoolkit=10.2.89=h74a9793_1
  - freetype=2.10.4=hd328e21_0
  - intel-openmp=2021.3.0=haa95532_3372
  - jpeg=9b=hb83a4c4_2
  - libpng=1.6.37=h2a8f88b_0
  - libtiff=4.2.0=hd0e1b90_0
  - libuv=1.40.0=he774522_0
  - lz4-c=1.9.3=h2bbff1b_1
  - mkl=2021.3.0=haa95532_524
  - ninja=1.10.2=h6d14046_1
  - olefile=0.46=py_0
  - openssl=1.1.1k=h2bbff1b_0
  - pillow=8.3.1=py38h4fa10fc_0
  - pip=21.2.2=py38haa95532_0
  - python=3.8.11=h6244533_1
  - pytorch=1.9.0=py3.8_cuda10.2_cudnn7_0
  - setuptools=52.0.0=py38haa95532_0
  - sqlite=3.36.0=h2bbff1b_0
  - tk=8.6.10=he774522_0
  - torchvision=0.10.0=py38_cu102
  - typing_extensions=3.10.0.0=pyh06a4308_0
  - vc=14.2=h21ff451_1
  - vs2015_runtime=14.27.29016=h5e58377_2
  - wheel=0.36.2=pyhd3eb1b0_0
  - wincertstore=0.2=py38_0
  - xz=5.2.5=h62dcd97_0
  - zlib=1.2.11=h62dcd97_4
  - zstd=1.4.9=h19a0ad4_0
prefix: C:\Users\Harshit\Anaconda3\envs\adversarialDl

Possible Resolution

Most common resolution is to remove extra packages, and remove versions from those which are not hard requirements. This will be need someone to do it manually.

Another option is to create separate, platform-dependent environment files.

someshsingh22 commented 3 years ago

Thanks for mentioning that @gchhablani, do you want to take this up ?

gchhablani commented 3 years ago

@someshsingh22 Sure, how do you want to resolve this?

gchhablani commented 3 years ago

Using a separate file for each environment will be cumbersome, wdyt?

someshsingh22 commented 3 years ago

@gchhablani The error I am receiving is mentioned here so I think its not a good ide to use .yml lets rather stick to requirements.txt https://stackoverflow.com/questions/48439159/failed-to-create-anaconda-environment-resolvepackagenotfound

someshsingh22 commented 3 years ago

Removing environment.yml