chensong1995 / HybridPose

HybridPose: 6D Object Pose Estimation under Hybrid Representation (CVPR 2020)
MIT License
419 stars 64 forks source link

problem solving the environment in Ubuntu 22.04 stuck at Solving environment: ...working... #83

Closed monajalal closed 1 year ago

monajalal commented 1 year ago

I am trying to follow the instructions on README.md to build the conda environment in Ubuntu 22.04 and get the following warnings and then gets stuck. Does it work on Ubuntu 22.04? Can you please suggest a fix?

(base) mona@mona-ThinkStation-P7:~$ conda create -y --name hp python==3.7.4
Retrieving notices: ...working... done
Collecting package metadata (current_repodata.json): done
Solving environment: unsuccessful attempt using repodata from current_repodata.json, retrying with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: done

==> WARNING: A newer version of conda exists. <==
  current version: 23.7.4
  latest version: 23.9.0

Please update conda by running

    $ conda update -n base -c defaults conda

Or to minimize the number of packages updated during conda update use

     conda install conda=23.9.0

## Package Plan ##

  environment location: /home/mona/anaconda3/envs/hp

  added / updated specs:
    - python==3.7.4

The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    certifi-2022.12.7          |   py37h06a4308_0         150 KB
    ------------------------------------------------------------
                                           Total:         150 KB

The following NEW packages will be INSTALLED:

  _libgcc_mutex      pkgs/main/linux-64::_libgcc_mutex-0.1-main 
  _openmp_mutex      pkgs/main/linux-64::_openmp_mutex-5.1-1_gnu 
  ca-certificates    pkgs/main/linux-64::ca-certificates-2023.08.22-h06a4308_0 
  certifi            pkgs/main/linux-64::certifi-2022.12.7-py37h06a4308_0 
  libedit            pkgs/main/linux-64::libedit-3.1.20221030-h5eee18b_0 
  libffi             pkgs/main/linux-64::libffi-3.2.1-hf484d3e_1007 
  libgcc-ng          pkgs/main/linux-64::libgcc-ng-11.2.0-h1234567_1 
  libgomp            pkgs/main/linux-64::libgomp-11.2.0-h1234567_1 
  libstdcxx-ng       pkgs/main/linux-64::libstdcxx-ng-11.2.0-h1234567_1 
  ncurses            pkgs/main/linux-64::ncurses-6.4-h6a678d5_0 
  openssl            pkgs/main/linux-64::openssl-1.1.1w-h7f8727e_0 
  pip                pkgs/main/linux-64::pip-22.3.1-py37h06a4308_0 
  python             pkgs/main/linux-64::python-3.7.4-h265db76_1 
  readline           pkgs/main/linux-64::readline-7.0-h7b6447c_5 
  setuptools         pkgs/main/linux-64::setuptools-65.6.3-py37h06a4308_0 
  sqlite             pkgs/main/linux-64::sqlite-3.33.0-h62c20be_0 
  tk                 pkgs/main/linux-64::tk-8.6.12-h1ccaba5_0 
  wheel              pkgs/main/linux-64::wheel-0.38.4-py37h06a4308_0 
  xz                 pkgs/main/linux-64::xz-5.4.2-h5eee18b_0 
  zlib               pkgs/main/linux-64::zlib-1.2.13-h5eee18b_0 

Downloading and Extracting Packages

Preparing transaction: done
Verifying transaction: done
Executing transaction: done
#
# To activate this environment, use
#
#     $ conda activate hp
#
# To deactivate an active environment, use
#
#     $ conda deactivate

(base) mona@mona-ThinkStation-P7:~$ conda install -y -q --name hp -c pytorch -c anaconda -c conda-forge -c pypi --file requirements.txt

Solving environment: ...working... 
(base) mona@mona-ThinkStation-P7:~/HybridPose$ conda install -y -q --name hp -c pytorch -c anaconda -c conda-forge -c pypi --file requirements.txt
Collecting package metadata (current_repodata.json): ...working... WARNING conda.models.version:get_matcher(556): Using .* with relational operator is superfluous and deprecated and will be removed in a future version of conda. Your spec was 1.7.1.*, but conda is ignoring the .* and treating it as 1.7.1
done
Solving environment: ...working... unsuccessful initial attempt using frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): ...working... WARNING conda.models.version:get_matcher(556): Using .* with relational operator is superfluous and deprecated and will be removed in a future version of conda. Your spec was 1.8.0.*, but conda is ignoring the .* and treating it as 1.8.0
WARNING conda.models.version:get_matcher(556): Using .* with relational operator is superfluous and deprecated and will be removed in a future version of conda. Your spec was 1.9.0.*, but conda is ignoring the .* and treating it as 1.9.0
WARNING conda.models.version:get_matcher(556): Using .* with relational operator is superfluous and deprecated and will be removed in a future version of conda. Your spec was 1.6.0.*, but conda is ignoring the .* and treating it as 1.6.0
done
Solving environment: ...working... 

Here's the list of requirements.txt:

$ cat requirements.txt 
pillow>=6.2.2
pytorch==1.2.0
torchvision==0.4.0
cudatoolkit==10.0.130
opencv==3.4.7
setuptools==65.5.1
scikit-learn==0.21.3

also cross-posted here since it is mainly a conda issue: https://github.com/conda/conda/issues/13229

chensong1995 commented 1 year ago

Hi Mona,

My understanding is that many of the 3rd party Python packages have interdependencies. When a package releases a new version, the author is responsible for updating the list of dependent package versions with conda. Unfortunately, this is not an easy job. The problem you are seeing is likely the result of conflicting dependencies.

While I encourage you to check if conda/conda has a better solution for you, here is what I think will solve the issue:

  1. Create a new conda environment. The Python version probably does not matter a lot. Either 3.7, 3.8, or 3.9 should work.
  2. Activate the conda environment.
  3. Follow the instructions here and install PyTorch with conda. I think the latest version should work. After installation, if you see any error about deprecated PyTorch methods, please follow the error message and change the calling signature.
  4. For the rest of the packages in requirements.txt, search "conda install " on Google. For example, "conda install scikit-learn". Click the link from anaconda.org, and run the command you find on the page. Again, the version probably does not matter too much. The latest version will most likely work.
  5. If step 4 fails, search "pip install " on Google instead. Check if there are similar commands you can use to install the package using pip and execute these commands.

I hope this helps! Let me know if you have further concerns.