jonbarron / camp_zipnerf

Apache License 2.0
657 stars 41 forks source link

Two possible bugs found when training CamP #22

Open lxndrrss opened 5 months ago

lxndrrss commented 5 months ago

Hi, I have stumbled upon two problems when training CamP. I was using zipnerf/360.gin and camp/camera_optim_perturbed.gin. The two Problems are:

  1. I got the error module 'camp_zipnerf.internal.math' has no attribute 'normalize'. I was able to fix this by changing math.normalize to spin_math.normalize here: https://github.com/jonbarron/camp_zipnerf/blob/d5022492de54a618c9651d0e4934bbe188a41532/camp_zipnerf/internal/camera_utils.py#L1689
  2. After resolving the first problem I got the error "Model" object has no attribute "grid_representation" raised here: https://github.com/jonbarron/camp_zipnerf/blob/d5022492de54a618c9651d0e4934bbe188a41532/camp_zipnerf/internal/train_utils.py#L618-L622 Simply commenting out the lines fixed the issue and training worked.

Are these actually Bugs or am I missing something?

BobH233 commented 1 month ago

Same error here:

Traceback (most recent call last):
  File "<runpy>", line 198, in _run_module_as_main
  File "<runpy>", line 88, in _run_code
  File "train.py", line 555, in <module>
    app.run(main)
  File "app.py", line 308, in run
    _run_main(main, args)
  File "app.py", line 254, in _run_main
    sys.exit(main(argv))
  File "train.py", line 130, in main
    cameras = dataset.get_train_cameras(config)
  File "datasets.py", line 861, in get_train_cameras
    cameras = self._get_perturbed_cameras(config)
  File "datasets.py", line 891, in _get_perturbed_cameras
    perturbed_cameras = camera_utils.perturb_cameras(
  File "camera_utils.py", line 1689, in perturb_cameras
    perturb_dir = math.normalize(random.normal(key, camera_positions.shape))
AttributeError: module 'math' has no attribute 'normalize'