princeton-vl / Oriented1D

Official code for ICCV 2023 paper "Convolutional Networks with Oriented 1D Kernels"
MIT License
44 stars 1 forks source link

No such file or directory: '/usr/local/lib/python3.8/dist-packages/kernels/kernels.h' #1

Closed chihchiehchen closed 5 months ago

chihchiehchen commented 5 months ago

Hello,

Thanks for sharing your work/code. Unfortunately, while installing the software, I ran into some problems.

When I typed pip install -e . , I got the following error messages:

ERROR: Command errored out with exit status 1: command: /home/ccchen/miniconda3/envs/ssl/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/home/ccchen/projects/Oriented1D/models/dwoconv1d/setup.py'"'"'; file='"'"'/home/ccchen/projects/Oriented1D/models/dwoconv1d/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' develop --no-deps cwd: /home/ccchen/projects/Oriented1D/models/dwoconv1d/ Complete output (3 lines): running develop running egg_info error: [Errno 13] Permission denied

ERROR: Command errored out with exit status 1: /home/ccchen/miniconda3/envs/ssl/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/home/ccchen/projects/Oriented1D/models/dwoconv1d/setup.py'"'"'; file='"'"'/home/ccchen/projects/Oriented1D/models/dwoconv1d/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' develop --no-deps Check the logs for full command output.

When I tried to use "pip install ." instead, I installed the packages successfully. However, when I tried to run analysis/benchmark.py to see if the package works well, I got another error messages:

self.theta = torch.nn.Parameter(torch.tensor(angle)) Traceback (most recent call last): File "benchmark.py", line 107, in table5() File "benchmark.py", line 101, in table5 f, b, t = benchmark_method(f'{name} \tangle={angle:.1f}\t ', nn, x, n_iter, K=S, verbose=verbose) File "benchmark.py", line 27, in benchmark_method y = model(x) File "/home/ccchen/miniconda3/envs/ssl/lib/python3.7/site-packages/torch/nn/modules/module.py", line 889, in _call_impl result = self.forward(*input, *kwargs) File "/home/ccchen/miniconda3/envs/ssl/lib/python3.7/site-packages/dwoconv1d_specialized.py", line 187, in forward self.params, *get_tensor_hw(x, self.nhwc) File "/home/ccchen/miniconda3/envs/ssl/lib/python3.7/site-packages/dwoconv1d_specialized.py", line 73, in oriented_dwconv1d_get_module_from_params module = get_dwoconv1d_kernel(ftype, kernel_size, stride, pad, h, w) File "/home/ccchen/miniconda3/envs/ssl/lib/python3.7/site-packages/dwoconv1d_specialized_kernel.py", line 80, in get_dwoconv1d_kernel name, H, W, kernel_size, stride, pad, ftype, verbose=verbose File "/home/ccchen/miniconda3/envs/ssl/lib/python3.7/site-packages/dwoconv1d_specialized_kernel.py", line 51, in compile_dwoconv1d_kernel cuda_sources=[open(fn, "r").read() for fn in sources] + [kernel_impl], File "/home/ccchen/miniconda3/envs/ssl/lib/python3.7/site-packages/dwoconv1d_specialized_kernel.py", line 51, in cuda_sources=[open(fn, "r").read() for fn in sources] + [kernel_impl], FileNotFoundError: [Errno 2] No such file or directory: '/home/ccchen/miniconda3/envs/ssl/lib/python3.7/site-packages/kernels/kernels.h'

Could you give me some hints? In any case, thanks a lot!

akirchmeyer commented 5 months ago

Hi, thank you for your interest in our paper! Can you try running the command pip install -e . --user? It looks like you may have permission issues when installing the package. If this does not work, could you link the complete installation log, for example by doing pip install -v -e . --log log.txt and providing me with log.txt? Quick questions: which version of python and pip are you using? Which linux distribution (or which os)? What is your cuda version?

There's also a second solution although very hacky. You keep using pip install . and copy the kernel files it complains about (e.g. all the files in the kernels folder) to /home/ccchen/miniconda3/envs/ssl/lib/python3.7/site-packages/kernels/ as suggested by the second error log.

Let me know if any of those helps!

chihchiehchen commented 5 months ago

Hello Alexandre,

Thanks for your help. Yes, it works well when I use pip install -e . --user. The other method also works well.

Thanks a lot!

akirchmeyer commented 5 months ago

No worries! Happy that your problem is resolved! I'm closing this issue but let me know if you have other questions.