Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

need help, compile successfully but cannot run the code #26

Closed
Holmes-Alan opened this issue Mar 15, 2022 · 4 comments
Closed

need help, compile successfully but cannot run the code #26

Holmes-Alan opened this issue Mar 15, 2022 · 4 comments

Comments

@Holmes-Alan
Copy link

I can successfully compile the codes but when I tried to train the model using

python main_nerf.py data/fox --workspace trial_nerf --fp16 --ff --cuda_ray --gui

I got the errors as,

Traceback (most recent call last):
File "main_nerf.py", line 47, in
from nerf.network_ff import NeRFNetwork
File "D:\torch-ngp\nerf\network_ff.py", line 5, in
from encoding import get_encoder
File "D:\torch-ngp\encoding.py", line 5, in
from hashencoder import HashEncoder
File "D:\torch-ngp\hashencoder_init_.py", line 1, in
from .hashgrid import HashEncoder
File "D:\torch-ngp\hashencoder\hashgrid.py", line 9, in
from .backend import _backend
File "D:\torch-ngp\hashencoder\backend.py", line 6, in
_backend = load(name='_hash_encoder',
File "C:\Users\Miniconda3\envs\ngp\lib\site-packages\torch\utils\cpp_extension.py", line 986, in load
return _jit_compile(
File "C:\Users\Miniconda3\envs\ngp\lib\site-packages\torch\utils\cpp_extension.py", line 1193, in _jit_compile
_write_ninja_file_and_build_library(
File "C:\Users\Miniconda3\envs\ngp\lib\site-packages\torch\utils\cpp_extension.py", line 1285, in _write_ninja_file_and_build_library
_write_ninja_file_to_build_library(
File "C:\Users\Miniconda3\envs\ngp\lib\site-packages\torch\utils\cpp_extension.py", line 1679, in _write_ninja_file_to_build_library
_write_ninja_file(
File "C:\Users\Miniconda3\envs\ngp\lib\site-packages\torch\utils\cpp_extension.py", line 1790, in _write_ninja_file
cl_paths = subprocess.check_output(['where',
File "C:\Users\Miniconda3\envs\ngp\lib\subprocess.py", line 415, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "C:\Users\Miniconda3\envs\ngp\lib\subprocess.py", line 516, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['where', 'cl']' returned non-zero exit status 1.

I am using a computer with RTX3090, I tried using an environment with CUDA 11.0 and torch 1.7.2, I also tested on CUDA 11.3 and torch 1.9. They all failed.

Can you please tell me what is problem? Thank you!

@ashawkey
Copy link
Owner

Hi,
Are you using Windows or Linux? If it is on Windows, I found some related issues here and here, which seems to be a configuration problem of visual studio.

Besides, it's better to use torch 1.10, or you'll have to manually modify some lines (mostly removing indexing=... from torch.meshgrid() which does not exist in torch < 1.10)

@Holmes-Alan
Copy link
Author

Thanks very much for the quick reply! I think I have solved the problem. Cheers!

@ashawkey
Copy link
Owner

Glad to hear that, closed for now.

@Holmes-Alan
Copy link
Author

When I run

python main_nerf.py data/fox --workspace trial_nerf --fp16 --ff --cuda_ray --gui

I got the following error,

Traceback (most recent call last):
File "C:\Users\zhisong_liu\Miniconda3\envs\ngp\lib\site-packages\torch\utils\cpp_extension.py", line 1740, in _run_ninja_build
subprocess.run(
File "C:\Users\zhisong_liu\Miniconda3\envs\ngp\lib\subprocess.py", line 516, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1.

I tried to fix the problem on the '['ninja', '-v']' by '['ninja', '--version']', but I got another problem as,

Traceback (most recent call last):
File "main_nerf.py", line 53, in
from nerf.network import NeRFNetwork
File "D:\torch-ngp\nerf\network.py", line 5, in
from encoding import get_encoder
File "D:\torch-ngp\encoding.py", line 5, in
from hashencoder import HashEncoder
File "D:\torch-ngp\hashencoder_init_.py", line 1, in
from .hashgrid import HashEncoder
File "D:\torch-ngp\hashencoder\hashgrid.py", line 9, in
from .backend import _backend
File "D:\torch-ngp\hashencoder\backend.py", line 6, in
_backend = load(name='_hash_encoder',
File "C:\Users\Miniconda3\envs\ngp\lib\site-packages\torch\utils\cpp_extension.py", line 1144, in load
return _jit_compile(
File "C:\Users\Miniconda3\envs\ngp\lib\site-packages\torch\utils\cpp_extension.py", line 1382, in _jit_compile
return _import_module_from_library(name, build_directory, is_python_module)
File "C:\Users\Miniconda3\envs\ngp\lib\site-packages\torch\utils\cpp_extension.py", line 1775, in _import_module_from_library
module = importlib.util.module_from_spec(spec)
ImportError: DLL load failed while importing _hash_encoder: The specified module could not be found.

What should I do?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants