facebookresearch / pytorch3d

PyTorch3D is FAIR's library of reusable components for deep learning with 3D data
https://pytorch3d.org/
Other
8.81k stars 1.32k forks source link

Numpy Version? #1110

Closed Hiusam closed 2 years ago

Hiusam commented 2 years ago

Does pytorch3d only support numpy and numpy-base with version >= 1.21? I have a package compatible with numpy <= 1.19.5 only what can I do?

bottler commented 2 years ago

No, we shouldn't have a requirement for such a new numpy. Why would you think we might?

Hiusam commented 2 years ago

Because when I execute: conda install pytorch3d -c pytorch3d conda says:

==> WARNING: A newer version of conda exists. <==
  current version: 4.10.3
  latest version: 4.11.0

Please update conda by running

    $ conda update -n base -c defaults conda

## Package Plan ##

  environment location: /home/xurunsen/anaconda3/envs/pytorch3d

  added / updated specs:
    - pytorch3d

The following NEW packages will be INSTALLED:

  mkl_fft            pkgs/main/linux-64::mkl_fft-1.3.1-py37hd3c417c_0
  mkl_random         pkgs/main/linux-64::mkl_random-1.2.2-py37h51133e4_0
  numpy              pkgs/main/linux-64::numpy-1.21.2-py37h20f2e39_0
  numpy-base         pkgs/main/linux-64::numpy-base-1.21.2-py37h79a1101_0
  pytorch3d          pytorch3d/linux-64::pytorch3d-0.6.1-py37_cu102_pyt190

It tries to install such a new version.

Hiusam commented 2 years ago

I think mayne such a new version numpy is required by pytorch1.9(cuda 10.2).

bottler commented 2 years ago

This is odd. It thinks you don't have numpy (because it says INSTALLED not UPGRADED). Can you paste the full output of conda list before you run that command?

Hiusam commented 2 years ago

Because I uninstalled the numpy at that time. Here is my original env without installing pytorch3d and its requirements.

# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                        main  
_openmp_mutex             4.5                       1_gnu  
absl-py                   1.0.0                    pypi_0    pypi
addict                    2.4.0                    pypi_0    pypi
argon2-cffi               21.3.0                   pypi_0    pypi
argon2-cffi-bindings      21.2.0                   pypi_0    pypi
attrs                     21.4.0                   pypi_0    pypi
backcall                  0.2.0                    pypi_0    pypi
black                     22.1.0                   pypi_0    pypi
blas                      1.0                         mkl  
bleach                    4.1.0                    pypi_0    pypi
bzip2                     1.0.8                h7b6447c_0  
ca-certificates           2022.2.1             h06a4308_0  
cachetools                5.0.0                    pypi_0    pypi
certifi                   2021.10.8        py37h06a4308_2  
cffi                      1.15.0                   pypi_0    pypi
charset-normalizer        2.0.12                   pypi_0    pypi
click                     8.0.4                    pypi_0    pypi
cudatoolkit               10.2.89              hfd86e86_1  
cycler                    0.11.0                   pypi_0    pypi
debugpy                   1.5.1                    pypi_0    pypi
decorator                 5.1.1                    pypi_0    pypi
defusedxml                0.7.1                    pypi_0    pypi
descartes                 1.1.0                    pypi_0    pypi
entrypoints               0.4                      pypi_0    pypi
ffmpeg                    4.3                  hf484d3e_0    pytorch
fire                      0.4.0                    pypi_0    pypi
flake8                    4.0.1                    pypi_0    pypi
fonttools                 4.29.1                   pypi_0    pypi
freetype                  2.11.0               h70c0345_0  
giflib                    5.2.1                h7b6447c_0  
gmp                       6.2.1                h2531618_2  
gnutls                    3.6.15               he1e5248_0  
google-auth               2.6.0                    pypi_0    pypi
google-auth-oauthlib      0.4.6                    pypi_0    pypi
grpcio                    1.44.0                   pypi_0    pypi
idna                      3.3                      pypi_0    pypi
imageio                   2.15.0                   pypi_0    pypi
importlib-metadata        4.2.0                    pypi_0    pypi
importlib-resources       5.4.0                    pypi_0    pypi
iniconfig                 1.1.1                    pypi_0    pypi
intel-openmp              2021.4.0          h06a4308_3561  
ipdb                      0.13.9                   pypi_0    pypi
ipykernel                 6.9.1                    pypi_0    pypi
ipython                   7.32.0                   pypi_0    pypi
ipython-genutils          0.2.0                    pypi_0    pypi
ipywidgets                7.6.5                    pypi_0    pypi
jedi                      0.18.1                   pypi_0    pypi
jinja2                    3.0.3                    pypi_0    pypi
joblib                    1.1.0                    pypi_0    pypi
jpeg                      9b                   h024ee3a_2  
jsonschema                4.4.0                    pypi_0    pypi
jupyter                   1.0.0                    pypi_0    pypi
jupyter-client            7.1.2                    pypi_0    pypi
jupyter-console           6.4.3                    pypi_0    pypi
jupyter-core              4.9.2                    pypi_0    pypi
jupyterlab-pygments       0.1.2                    pypi_0    pypi
jupyterlab-widgets        1.0.2                    pypi_0    pypi
kiwisolver                1.3.2                    pypi_0    pypi
lame                      3.100                h7b6447c_0  
lcms2                     2.12                 h3be6417_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  
libiconv                  1.15                 h63c8f33_5  
libidn2                   2.3.2                h7f8727e_0  
libpng                    1.6.37               hbc83047_0  
libstdcxx-ng              9.3.0               hd4cf53a_17  
libtasn1                  4.16.0               h27cfd23_0  
libtiff                   4.1.0                h2733197_1  
libunistring              0.9.10               h27cfd23_0  
libuv                     1.40.0               h7b6447c_0  
libwebp                   1.2.0                h89dd481_0  
llvmlite                  0.31.0                   pypi_0    pypi
lyft-dataset-sdk          0.0.8                    pypi_0    pypi
lz4-c                     1.9.3                h295c915_1  
markdown                  3.3.4                    pypi_0    pypi
markupsafe                2.1.0                    pypi_0    pypi
matplotlib                3.5.1                    pypi_0    pypi
matplotlib-inline         0.1.3                    pypi_0    pypi
mccabe                    0.6.1                    pypi_0    pypi
mistune                   0.8.4                    pypi_0    pypi
mkl                       2021.4.0           h06a4308_640  
mkl-service               2.4.0            py37h7f8727e_0  
mkl_fft                   1.3.1            py37hd3c417c_0  
mkl_random                1.2.2            py37h51133e4_0  
mmcv-full                 1.4.0                     dev_0    <develop>
mmdet                     2.14.0                   pypi_0    pypi
mmdet3d                   0.15.0                    dev_0    <develop>
mmsegmentation            0.14.1                   pypi_0    pypi
mypy-extensions           0.4.3                    pypi_0    pypi
nbclient                  0.5.12                   pypi_0    pypi
nbconvert                 6.4.2                    pypi_0    pypi
nbformat                  5.1.3                    pypi_0    pypi
ncurses                   6.3                  h7f8727e_2  
nest-asyncio              1.5.4                    pypi_0    pypi
nettle                    3.7.3                hbbd107a_1  
networkx                  2.2                      pypi_0    pypi
ninja                     1.10.2           py37hd09550d_3  
notebook                  6.4.8                    pypi_0    pypi
numba                     0.48.0                   pypi_0    pypi
numpy                     1.19.5                   pypi_0    pypi
nuscenes-devkit           1.1.9                    pypi_0    pypi
oauthlib                  3.2.0                    pypi_0    pypi
opencv-python             4.5.5.64                 pypi_0    pypi
openh264                  2.1.1                h4ff587b_0  
openssl                   1.1.1m               h7f8727e_0  
packaging                 21.3                     pypi_0    pypi
pandas                    1.3.5                    pypi_0    pypi
pandocfilters             1.5.0                    pypi_0    pypi
parso                     0.8.3                    pypi_0    pypi
pathspec                  0.9.0                    pypi_0    pypi
pexpect                   4.8.0                    pypi_0    pypi
pickleshare               0.7.5                    pypi_0    pypi
pillow                    9.0.1            py37h22f2fdc_0  
pip                       21.2.2           py37h06a4308_0  
platformdirs              2.5.1                    pypi_0    pypi
plotly                    5.6.0                    pypi_0    pypi
pluggy                    1.0.0                    pypi_0    pypi
plyfile                   0.7.4                    pypi_0    pypi
prettytable               3.2.0                    pypi_0    pypi
prometheus-client         0.13.1                   pypi_0    pypi
prompt-toolkit            3.0.28                   pypi_0    pypi
protobuf                  3.19.4                   pypi_0    pypi
ptyprocess                0.7.0                    pypi_0    pypi
py                        1.11.0                   pypi_0    pypi
pyasn1                    0.4.8                    pypi_0    pypi
pyasn1-modules            0.2.8                    pypi_0    pypi
pycocotools               2.0.4                    pypi_0    pypi
pycodestyle               2.8.0                    pypi_0    pypi
pycparser                 2.21                     pypi_0    pypi
pyflakes                  2.4.0                    pypi_0    pypi
pygments                  2.11.2                   pypi_0    pypi
pyparsing                 3.0.7                    pypi_0    pypi
pyquaternion              0.9.9                    pypi_0    pypi
pyrsistent                0.18.1                   pypi_0    pypi
pytest                    7.0.1                    pypi_0    pypi
python                    3.7.11               h12debd9_0  
python-dateutil           2.8.2                    pypi_0    pypi
pytorch                   1.9.0           py3.7_cuda10.2_cudnn7.6.5_0    pytorch
pytz                      2021.3                   pypi_0    pypi
pywavelets                1.2.0                    pypi_0    pypi
pyyaml                    6.0                      pypi_0    pypi
pyzmq                     22.3.0                   pypi_0    pypi
qtconsole                 5.2.2                    pypi_0    pypi
qtpy                      2.0.1                    pypi_0    pypi
readline                  8.1.2                h7f8727e_1  
requests                  2.27.1                   pypi_0    pypi
requests-oauthlib         1.3.1                    pypi_0    pypi
rsa                       4.8                      pypi_0    pypi
scikit-image              0.19.2                   pypi_0    pypi
scikit-learn              1.0.2                    pypi_0    pypi
scipy                     1.7.3                    pypi_0    pypi
send2trash                1.8.0                    pypi_0    pypi
setuptools                58.0.4           py37h06a4308_0  
shapely                   1.8.1.post1              pypi_0    pypi
six                       1.16.0             pyhd3eb1b0_1  
sqlite                    3.37.2               hc218d9a_0  
tenacity                  8.0.1                    pypi_0    pypi
tensorboard               2.8.0                    pypi_0    pypi
tensorboard-data-server   0.6.1                    pypi_0    pypi
tensorboard-plugin-wit    1.8.1                    pypi_0    pypi
termcolor                 1.1.0                    pypi_0    pypi
terminado                 0.13.3                   pypi_0    pypi
terminaltables            3.1.10                   pypi_0    pypi
testpath                  0.6.0                    pypi_0    pypi
threadpoolctl             3.1.0                    pypi_0    pypi
tifffile                  2021.11.2                pypi_0    pypi
tk                        8.6.11               h1ccaba5_0  
toml                      0.10.2                   pypi_0    pypi
tomli                     2.0.1                    pypi_0    pypi
torchaudio                0.9.0                      py37    pytorch
torchvision               0.10.0               py37_cu102    pytorch
tornado                   6.1                      pypi_0    pypi
tqdm                      4.63.0                   pypi_0    pypi
traitlets                 5.1.1                    pypi_0    pypi
trimesh                   2.35.39                  pypi_0    pypi
typed-ast                 1.5.2                    pypi_0    pypi
typing_extensions         3.10.0.2           pyh06a4308_0  
urllib3                   1.26.8                   pypi_0    pypi
wcwidth                   0.2.5                    pypi_0    pypi
webencodings              0.5.1                    pypi_0    pypi
werkzeug                  2.0.3                    pypi_0    pypi
wheel                     0.37.1             pyhd3eb1b0_0  
widgetsnbextension        3.5.2                    pypi_0    pypi
xz                        5.2.5                h7b6447c_0  
yapf                      0.32.0                   pypi_0    pypi
zipp                      3.7.0                    pypi_0    pypi
zlib                      1.2.11               h7f8727e_4  
zstd                      1.4.9                haebb681_0  

I think the problem is that my original environment is installed with NumPy 1.19.5 and when installing pytorch3d, it tries to install NumPy-base 1.21.2, and my env cannot work properly. I have solved the problem by installing PyTorch and pytorch3d first, which will install NumPy 1.21.2 and then installed other packages that required lower version NumPy, and NumPy will become 1.195. It seems that the env works well in this way, though I think there may be some inconsistency.

bottler commented 2 years ago

I think the distinction might be whether numpy is installed from conda or not. The PyTorch3D conda package depends on the numpy conda package, and your numpy was from pypi. So when you try to install pytorch3d it is as if you don't have numpy so tries to find it, which takes the current version. I'm glad you've got round the problem.