question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NameError: name 'tcnn' is not defined when trying to train nerfacto

See original GitHub issue

Describe the bug I get a NameError: name 'tcnn' is not defined error right after starting to train nerfacto model Vanilla model is trained without issues though

[visualizer.py:96] Sending ping to the viewer Bridge Server...
[visualizer.py:98] Successfully connected.
[WARNING] Not running eval iterations since only viewer is enabled. Use `--vis wandb` or `--vis tensorboard` to run
with eval instead.
disabled tensorboard/wandb event writers
Auto image downscale factor of 2
[nerfstudio_dataparser.py:91] Skipping 0 files in dataset split train.
Auto image downscale factor of 2
[nerfstudio_dataparser.py:91] Skipping 0 files in dataset split val.
Loading data batch ---------------------------------------- 100% 0:00:00
Loading data batch ---------------------------------------- 100% 0:00:00
[profiler.py:85] Printing profiling stats, from longest to shortest duration in seconds
Traceback (most recent call last):
  File "C:\Users\user\miniconda3\envs\nerfstudio\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\user\miniconda3\envs\nerfstudio\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\user\miniconda3\envs\nerfstudio\Scripts\ns-train.exe\__main__.py", line 7, in <module>
  File "C:\Code\nerfstudio\scripts\train.py", line 216, in entrypoint
    main(tyro.cli(AnnotatedBaseConfigUnion))
  File "C:\Code\nerfstudio\scripts\train.py", line 202, in main
    launch(
  File "C:\Code\nerfstudio\scripts\train.py", line 145, in launch
    main_func(local_rank=0, world_size=1, config=config)
  File "C:\Code\nerfstudio\nerfstudio\engine\trainer.py", line 62, in train_loop
    trainer.setup()
  File "C:\Code\nerfstudio\nerfstudio\engine\trainer.py", line 129, in setup
    self.pipeline: VanillaPipeline = self.config.pipeline.setup(
  File "C:\Code\nerfstudio\nerfstudio\configs\base_config.py", line 62, in setup
    return self._target(self, **kwargs)
  File "C:\Code\nerfstudio\nerfstudio\pipelines\base_pipeline.py", line 220, in __init__
    self._model = config.model.setup(
  File "C:\Code\nerfstudio\nerfstudio\configs\base_config.py", line 62, in setup
    return self._target(self, **kwargs)
  File "C:\Code\nerfstudio\nerfstudio\models\base_model.py", line 80, in __init__
    self.populate_modules()  # populate the modules
  File "C:\Code\nerfstudio\nerfstudio\models\nerfacto.py", line 104, in populate_modules
    self.field = TCNNNerfactoField(
  File "C:\Code\nerfstudio\nerfstudio\fields\nerfacto_field.py", line 123, in __init__
    self.direction_encoding = tcnn.Encoding(
NameError: name 'tcnn' is not defined

Windows 10 Nvidia A6000

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
dokluchcommented, Oct 7, 2022

@akristoffersen just found out that tinycudann fails to install and to compile on my machine. Will try to investigate.

0reactions
THE-COBcommented, Dec 19, 2022

Hi, this generally means that tinycuda didn’t get installed correctly.

As a test, if you open up an interactive python environment, does importing tinycudann work? If not, this means that the conda environment hasn’t installed tinycuda correctly.

(nerfstudio) $ python3
> import tinycudann

Hi sorry I’m new here (so my issue might be dumb) and I’m working on install. I’m getting the same error as stated in the issue, but I think I was able to install tiny cuda nn using the instructions in readme. This runs perfectly fine:

(nerfstudio) PS C:\Users\rohan\Documents\fa22\cs194\nerfystuff> python
Python 3.8.15 (default, Nov 24 2022, 14:38:14) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import tinycudann
>>>

Any ideas?

EDIT: The problem was fixed when I built from source! Does it mean some new version just needs to be pushed to pip or whatever?

Read more comments on GitHub >

github_iconTop Results From Across the Web

NameError: name 'train' is not defined - python - Stack Overflow
You're encountering the said error because you don't have a NumPy array called train . So, you generated your dataset with the following ......
Read more >
Python nameerror name is not defined Solution - Career Karma
A NameError means that you've tried to use a variable that does not yet exist. In this guide, we're going to talk about...
Read more >
Advances in Neural Rendering - Eurographics Digital Library
Abstract. Synthesizing photo-realistic images and videos is at the heart of computer graphics and has been the focus of decades of research.
Read more >
Advances in Neural Rendering - Tewari - Wiley Online Library
This technique does not try to emulate the image formation process of the real world, but instead exploits the geometric properties of objects ......
Read more >
State of the Art in Dense Monocular Non-Rigid 3D ...
3D reconstruction of deformable (or non-rigid) scenes from a set of monocular 2D ... pixel of the virtual camera, it traces a ray...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found