microsoft / Cream

This is a collection of our NAS and Vision Transformer work.
MIT License
1.69k stars 230 forks source link

UserWarning: [WARNING] The module rpe_ops is not built. For better training performance, please build rpe_ops. #234

Closed MurphyYe closed 7 months ago

MurphyYe commented 7 months ago

I meet this question when I run the setup.py.

wkcn commented 7 months ago

Hi @MurphyYe , thanks for your attention to our work!

Could you please print the import exception by replacing these lines: https://github.com/microsoft/Cream/blob/main/iRPE/DeiT-with-iRPE/irpe.py#L8-L15

with the following codes:

try:
    from rpe_ops.rpe_index import RPEIndexFunction
except ImportError as e:
    print(e)
    RPEIndexFunction = None
    import warnings
    RED_STR = "\033[91m{}\033[00m"
    warnings.warn(RED_STR.format("[WARNING] The module `rpe_ops` is not built. \
For better training performance, please build `rpe_ops`."),)
MurphyYe commented 7 months ago

Thank you for your useful research and your reply. I did what you said and print the ImportError which is " No module named 'rpe_ops' ".

Hi @MurphyYe , thanks for your attention to our work!

Could you please print the import exception by replacing these lines: https://github.com/microsoft/Cream/blob/main/iRPE/DeiT-with-iRPE/irpe.py#L8-L15

with the following codes:

try:
    from rpe_ops.rpe_index import RPEIndexFunction
except ImportError as e:
    print(e)
    RPEIndexFunction = None
    import warnings
    RED_STR = "\033[91m{}\033[00m"
    warnings.warn(RED_STR.format("[WARNING] The module `rpe_ops` is not built. \
For better training performance, please build `rpe_ops`."),)
MurphyYe commented 7 months ago

The whole description is that “ running install running bdist_egg running egg_info writing rpe_index.egg-info/PKG-INFO writing dependency_links to rpe_index.egg-info/dependency_links.txt writing top-level names to rpe_index.egg-info/top_level.txt reading manifest file 'rpe_index.egg-info/SOURCES.txt' writing manifest file 'rpe_index.egg-info/SOURCES.txt' installing library code to build/bdist.linux-x86_64/egg running install_lib running build_ext building 'rpe_index_cpp' extension Emitting ninja build file /root/autodl-tmp/diffusion-based-Segmentation/iRPE/rpe_ops/build/temp.linux-x86_64-3.8/build.ninja... Compiling objects... Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N) ninja: no work to do. g++ -pthread -shared -B /root/miniconda3/compiler_compat -L/root/miniconda3/lib -Wl,-rpath=/root/miniconda3/lib -Wl,--no-as-needed -Wl,--sysroot=/ /root/autodl-tmp/diffusion-based-Segmentation/iRPE/rpe_ops/build/temp.linux-x86_64-3.8/rpe_index.o /root/autodl-tmp/diffusion-based-Segmentation/iRPE/rpe_ops/build/temp.linux-x86_64-3.8/rpe_index_cuda.o -L/root/miniconda3/lib/python3.8/site-packages/torch/lib -L/usr/local/cuda/lib64 -lc10 -ltorch -ltorch_cpu -ltorch_python -lcudart -lc10_cuda -ltorch_cuda_cu -ltorch_cuda_cpp -o build/lib.linux-x86_64-3.8/rpe_index_cpp.cpython-38-x86_64-linux-gnu.so creating build/bdist.linux-x86_64/egg copying build/lib.linux-x86_64-3.8/rpe_index_cpp.cpython-38-x86_64-linux-gnu.so -> build/bdist.linux-x86_64/egg creating stub loader for rpe_index_cpp.cpython-38-x86_64-linux-gnu.so byte-compiling build/bdist.linux-x86_64/egg/rpe_index_cpp.py to rpe_index_cpp.cpython-38.pyc creating build/bdist.linux-x86_64/egg/EGG-INFO copying rpe_index.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO copying rpe_index.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO copying rpe_index.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO copying rpe_index.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 zip_safe flag not set; analyzing archive contents... pycache.rpe_index_cpp.cpython-38: module references file creating 'dist/rpe_index-1.2.0-py3.8-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 rpe_index-1.2.0-py3.8-linux-x86_64.egg removing '/root/.local/lib/python3.8/site-packages/rpe_index-1.2.0-py3.8-linux-x86_64.egg' (and everything under it) creating /root/.local/lib/python3.8/site-packages/rpe_index-1.2.0-py3.8-linux-x86_64.egg Extracting rpe_index-1.2.0-py3.8-linux-x86_64.egg to /root/.local/lib/python3.8/site-packages rpe-index 1.2.0 is already the active version in easy-install.pth

Installed /root/.local/lib/python3.8/site-packages/rpe_index-1.2.0-py3.8-linux-x86_64.egg Processing dependencies for rpe-index==1.2.0 Finished processing dependencies for rpe-index==1.2.0

wkcn commented 7 months ago

@MurphyYe Thank you for providing the detailed information!

The reason is that the module rpe_ops can not be imported when running python on the other-level path.

I have fixed the bug. You can update the file irpe.py (https://github.com/wkcn/Cream/blob/dev/iRPE/DeiT-with-iRPE/irpe.py)

MurphyYe commented 7 months ago

@MurphyYe Thank you for providing the detailed information!

The reason is that the module rpe_ops can not be imported when running python on the other-level path.

I have fixed the bug. You can update the file irpe.py (https://github.com/wkcn/Cream/blob/dev/iRPE/DeiT-with-iRPE/irpe.py)

Thank you for your directly work and it seems like everything is good now. I will close the comment later. Peace!