ImCharlesY / AdaInt

[CVPR 2022] Official PyTorch Implementation of "AdaInt: Learning Adaptive Intervals for 3D Lookup Tables on Real-time Image Enhancement" (https://arxiv.org/abs/2204.13983)
Apache License 2.0
173 stars 19 forks source link

ImportError:...undefined symbol: _ZNK2at10TensorBase8data_ptrIdEEPT_v #19

Open JimKimHome opened 1 year ago

JimKimHome commented 1 year ago

In docker contrainer

GCC version:7.5.0 CUDA:10.2 python:3.7.10 torch:1.8.1+cu102 torchvision:0.9.1+cu102 mmcv-full:1.3.17 mmedit:0.11.0

way to install Adaint: Compile and install the extension manually

JimKimHome commented 1 year ago

run command: python adaint/ailut_transform/setup.py install

running install /usr/local/lib/python3.7/site-packages/setuptools/command/install.py:37: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools. setuptools.SetuptoolsDeprecationWarning, /usr/local/lib/python3.7/site-packages/setuptools/command/easy_install.py:147: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools. EasyInstallDeprecationWarning, running bdist_egg running egg_info writing ailut.egg-info/PKG-INFO writing dependency_links to ailut.egg-info/dependency_links.txt writing top-level names to ailut.egg-info/top_level.txt /usr/local/lib/python3.7/site-packages/torch/utils/cpp_extension.py:369: UserWarning: Attempted to use ninja as the BuildExtension backend but we could not find ninja.. Falling back to using the slow distutils backend. warnings.warn(msg.format('we could not find ninja.')) reading manifest file 'ailut.egg-info/SOURCES.txt' writing manifest file 'ailut.egg-info/SOURCES.txt' installing library code to build/bdist.linux-x86_64/egg running install_lib running build_py running build_ext creating build/bdist.linux-x86_64/egg creating build/bdist.linux-x86_64/egg/ailut copying build/lib.linux-x86_64-cpython-37/ailut/pyinterfaces.py -> build/bdist.linux-x86_64/egg/ailut copying build/lib.linux-x86_64-cpython-37/ailut/version.py -> build/bdist.linux-x86_64/egg/ailut copying build/lib.linux-x86_64-cpython-37/ailut/init.py -> build/bdist.linux-x86_64/egg/ailut copying build/lib.linux-x86_64-cpython-37/ailut/_ext.cpython-37m-x86_64-linux-gnu.so -> build/bdist.linux-x86_64/egg/ailut byte-compiling build/bdist.linux-x86_64/egg/ailut/pyinterfaces.py to pyinterfaces.cpython-37.pyc byte-compiling build/bdist.linux-x86_64/egg/ailut/version.py to version.cpython-37.pyc byte-compiling build/bdist.linux-x86_64/egg/ailut/init.py to init.cpython-37.pyc creating stub loader for ailut/_ext.cpython-37m-x86_64-linux-gnu.so byte-compiling build/bdist.linux-x86_64/egg/ailut/_ext.py to _ext.cpython-37.pyc creating build/bdist.linux-x86_64/egg/EGG-INFO copying ailut.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO copying ailut.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO copying ailut.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO copying ailut.egg-info/not-zip-safe -> build/bdist.linux-x86_64/egg/EGG-INFO copying ailut.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO writing build/bdist.linux-x86_64/egg/EGG-INFO/native_libs.txt creating 'dist/ailut-1.5.0-py3.7-linux-x86_64.egg' and adding 'build/bdist.linux-x86_64/egg' to it removing 'build/bdist.linux-x86_64/egg' (and everything under it) Processing ailut-1.5.0-py3.7-linux-x86_64.egg removing '/usr/local/lib/python3.7/site-packages/ailut-1.5.0-py3.7-linux-x86_64.egg' (and everything under it) creating /usr/local/lib/python3.7/site-packages/ailut-1.5.0-py3.7-linux-x86_64.egg Extracting ailut-1.5.0-py3.7-linux-x86_64.egg to /usr/local/lib/python3.7/site-packages ailut 1.5.0 is already the active version in easy-install.pth

Installed /usr/local/lib/python3.7/site-packages/ailut-1.5.0-py3.7-linux-x86_64.egg Processing dependencies for ailut==1.5.0 Finished processing dependencies for ailut==1.5.0

JimKimHome commented 1 year ago

run python adaint/demo.py adaint/configs/fivekrgb.py pretrained/AiLUT-FiveK-sRGB.pth resources/a4739.jpg resources/a4739_enhanced.png

Traceback (most recent call last): File "/usr/local/lib/python3.7/site-packages/mmcv/utils/misc.py", line 73, in import_modules_from_strings imported_tmp = import_module(imp) File "/usr/local/lib/python3.7/importlib/init.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1006, in _gcd_import File "", line 983, in _find_and_load File "", line 967, in _find_and_load_unlocked File "", line 677, in _load_unlocked File "", line 728, in exec_module File "", line 219, in _call_with_frames_removed File "/home/zhanjinhao/AdaInt/adaint/init.py", line 1, in from .model import AiLUT File "/home/zhanjinhao/AdaInt/adaint/model.py", line 18, in from ailut import ailut_transform File "/usr/local/lib/python3.7/site-packages/ailut-1.5.0-py3.7-linux-x86_64.egg/ailut/init.py", line 1, in from .pyinterfaces import ailut_transform, lut_transform File "/usr/local/lib/python3.7/site-packages/ailut-1.5.0-py3.7-linux-x86_64.egg/ailut/pyinterfaces.py", line 6, in from ._ext import ( ImportError: /usr/local/lib/python3.7/site-packages/ailut-1.5.0-py3.7-linux-x86_64.egg/ailut/_ext.cpython-37m-x86_64-linux-gnu.so: undefined symbol: _ZNK2at10TensorBase8data_ptrIdEEPT_v

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "adaint/demo.py", line 75, in main() File "adaint/demo.py", line 67, in main args.config, args.checkpoint, device=torch.device('cuda', args.device)) File "/home/zhanjinhao/AdaInt/mmedit/apis/matting_inference.py", line 25, in init_model config = mmcv.Config.fromfile(config) File "/usr/local/lib/python3.7/site-packages/mmcv/utils/config.py", line 334, in fromfile import_modules_from_strings(**cfg_dict['custom_imports']) File "/usr/local/lib/python3.7/site-packages/mmcv/utils/misc.py", line 80, in import_modules_from_strings raise ImportError ImportError