nv-tlabs / NKSR

[CVPR 2023 Highlight] Neural Kernel Surface Reconstruction
https://research.nvidia.com/labs/toronto-ai/NKSR
Other
735 stars 43 forks source link

mamba installed and setup environment, nksr crashes at import #44

Closed kc9qey closed 11 months ago

kc9qey commented 11 months ago

`(/sw/external/python/nksr) [arnoldg@dt-login03 mamba]$ python Python 3.10.12 | packaged by conda-forge | (main, Jun 23 2023, 22:40:32) [GCC 12.3.0] on linux Type "help", "copyright", "credits" or "license" for more information.

import torch import nksr 09-18 12:48:59 (o3d.py:10) [ERROR] Open3D not installed! You can try either the following 2 options:

  1. (recommended, using customized Open3D that enables view sync, animation, ...)

pip install python-pycg[full] -f https://pycg.s3.ap-northeast-1.amazonaws.com/packages/index.html

  1. (using official Open3D)

pip install python-pycg[all]

Traceback (most recent call last): File "", line 1, in File "/sw/external/python/nksr/lib/python3.10/site-packages/nksr/init.py", line 18, in from nksr.nn.unet import SparseStructureNet File "/sw/external/python/nksr/lib/python3.10/site-packages/nksr/nn/init.py", line 10, in from .modules import Conv3d, GroupNorm, Activation, GroupNorm, MaxPooling, Upsampling, SparseZeroPadding File "/sw/external/python/nksr/lib/python3.10/site-packages/nksr/nn/modules.py", line 14, in from nksr.svh import SparseFeatureHierarchy, KernelMap, VoxelStatus File "/sw/external/python/nksr/lib/python3.10/site-packages/nksr/svh.py", line 17, in from pycg import vis File "/sw/external/python/nksr/lib/python3.10/site-packages/pycg/vis.py", line 9, in from pycg import o3d File "/sw/external/python/nksr/lib/python3.10/site-packages/pycg/o3d.py", line 8, in from open3d import * File "/sw/external/python/nksr/lib/python3.10/site-packages/open3d/init.py", line 102, in import open3d.visualization File "/sw/external/python/nksr/lib/python3.10/site-packages/open3d/visualization/init.py", line 38, in from .draw_plotly import draw_plotly File "/sw/external/python/nksr/lib/python3.10/site-packages/open3d/visualization/draw_plotly.py", line 31, in from dash import html File "/sw/external/python/nksr/lib/python3.10/site-packages/dash/init.py", line 5, in from .dependencies import ( # noqa: F401,E402 File "/sw/external/python/nksr/lib/python3.10/site-packages/dash/dependencies.py", line 4, in from ._validate import validate_callback File "/sw/external/python/nksr/lib/python3.10/site-packages/dash/_validate.py", line 5, in import flask File "/sw/external/python/nksr/lib/python3.10/site-packages/flask/init.py", line 4, in from . import json as json File "/sw/external/python/nksr/lib/python3.10/site-packages/flask/json/init.py", line 8, in from ..globals import current_app File "/sw/external/python/nksr/lib/python3.10/site-packages/flask/globals.py", line 4, in from werkzeug.local import LocalProxy File "/sw/external/python/nksr/lib/python3.10/site-packages/werkzeug/init.py", line 2, in from .test import Client as Client File "/sw/external/python/nksr/lib/python3.10/site-packages/werkzeug/test.py", line 19, in from .datastructures import Authorization File "/sw/external/python/nksr/lib/python3.10/site-packages/werkzeug/datastructures/init.py", line 11, in from .file_storage import FileMultiDict as FileMultiDict File "/sw/external/python/nksr/lib/python3.10/site-packages/werkzeug/datastructures/file_storage.py", line 8, in from .._internal import _plain_int ImportError: cannot import name '_plain_int' from 'werkzeug._internal' (/sw/external/python/nksr/lib/python3.10/site-packages/werkzeug/_internal.py)

(/sw/external/python/nksr) [arnoldg@dt-login03 mamba]$ pip list|grep nksr nksr 1.0.3+pt20cu118 (/sw/external/python/nksr) [arnoldg@dt-login03 mamba]$ pip list | grep pycg python-pycg 0.5.2 (/sw/external/python/nksr) [arnoldg@dt-login03 mamba]$

`

kc9qey commented 11 months ago

We worked around the above with: pip install --upgrade Werkzeug

After finding: https://stackoverflow.com/questions/76710888/importerror-cannot-import-name-plain-int-from-werkzeug-internal

(/sw/external/python/nksr) [arnoldg@dt-login03 mamba]$ pip install --upgrade Werkzeug Requirement already satisfied: Werkzeug in /sw/external/python/nksr/lib/python3.10/site-packages (2.2.3) Collecting Werkzeug Obtaining dependency information for Werkzeug from https://files.pythonhosted.org/packages/9b/59/a7c32e3d8d0e546a206e0552a2c04444544f15c1da4a01df8938d20c6ffc/werkzeug-2.3.7-py3-none-any.whl.metadata Downloading werkzeug-2.3.7-py3-none-any.whl.metadata (4.1 kB) Requirement already satisfied: MarkupSafe>=2.1.1 in /u/arnoldg/.local/lib/python3.10/site-packages (from Werkzeug) (2.1.3) Downloading werkzeug-2.3.7-py3-none-any.whl (242 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 242.2/242.2 kB 15.4 MB/s eta 0:00:00 Installing collected packages: Werkzeug Attempting uninstall: Werkzeug Found existing installation: Werkzeug 2.2.3 Uninstalling Werkzeug-2.2.3: Successfully uninstalled Werkzeug-2.2.3 ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. dash 2.13.0 requires Werkzeug<2.3.0, but you have werkzeug 2.3.7 which is incompatible. Successfully installed Werkzeug-2.3.7

tested python:

(/sw/external/python/nksr) [arnoldg@dt-login03 ~]$ python Python 3.10.12 | packaged by conda-forge | (main, Jun 23 2023, 22:40:32) [GCC 12.3.0] on linux Type "help", "copyright", "credits" or "license" for more information.

import torch import nksr exit() (/sw/external/python/nksr) [arnoldg@dt-login03 ~]$

Do you need to specify a newer Werkzeug in your environment.yml ?

heiwang1997 commented 11 months ago

Hi @kc9qey thanks for reporting this issue. Could you print out your current open3d version please?

python -c 'import open3d; print(open3d.__version__)'

Also is there any specific reason why you use mamba instead of conda?

kc9qey commented 11 months ago

(/sw/external/python/nksr) [arnoldg@dt-login02 mambaforge]$ python Python 3.10.12 | packaged by conda-forge | (main, Jun 23 2023, 22:40:32) [GCC 12.3.0] on linux Type "help", "copyright", "credits" or "license" for more information.

import open3d print(open3d.version) 0.16.1+c65c7ef

Mamba will solve and install in finite measurable time. Conda will not -- a common issue with Conda out the in real world ( and the very reason Mamba was written ).

heiwang1997 commented 11 months ago

That's a bit weird since the two packages (open3d and werkzeug 2.2.3) are compatible on my end:

>>> import open3d
>>> from dash import html
>>> import werkzeug
>>> print(open3d.__version__)
0.16.1+c65c7ef
>>> print(werkzeug.__version__)
2.2.3

By the way, mamba has integration with conda now: https://www.anaconda.com/blog/a-faster-conda-for-a-growing-community. So feel free to go back to conda again :)

kc9qey commented 11 months ago

Thanks for the update. You're the 2nd person to suggest that libmamba update...will give it a try on a production supercomputer today after i finishing backing up the anaconda installation.