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

Failing or Skipping Unit Tests #17

Open
BATspock opened this issue Mar 21, 2024 · 4 comments
Open

Failing or Skipping Unit Tests #17

BATspock opened this issue Mar 21, 2024 · 4 comments

Comments

@BATspock
Copy link

Hi, I am trying to run the set up and I decided to run the unit tests. I see the following outputs where the tests have failed or skipped:

(camp_zipnerf) a@test-nerf-server:~/camp_zipnerf$ ./scripts/run_all_unit_tests.sh 
Running camera_utils_test.py
./home/a/camp_zipnerf/internal/camera_utils.py:1178: RuntimeWarning: divide by zero encountered in divide
  t1 = (corners[0] - ray_o) / ray_d
/home/a/camp_zipnerf/internal/camera_utils.py:1179: RuntimeWarning: divide by zero encountered in divide
  t2 = (corners[1] - ray_o) / ray_d
..........
----------------------------------------------------------------------
Ran 11 tests in 19.966s

OK
Running coord_test.py
..s............F............s....s....s....s....s....s......s....s....s....s.....F....s....s.....
======================================================================
FAIL: test_construct_ray_warps_is_finite_and_in_range6 (0.5) (tests.coord_test.CoordTest)
tests.coord_test.CoordTest.test_construct_ray_warps_is_finite_and_in_range6 (0.5)
test_construct_ray_warps_is_finite_and_in_range(0.5)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/opt/conda/envs/camp_zipnerf/lib/python3.11/site-packages/absl/testing/parameterized.py", line 323, in bound_param_test
    return test_method(self, testcase_params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/a/camp_zipnerf/tests/coord_test.py", line 93, in test_construct_ray_warps_is_finite_and_in_range
    self.assertTrue(jnp.all(s_recon <= 1))
AssertionError: Array(False, dtype=bool) is not true

======================================================================
FAIL: test_pos_enc_20_0.2 (tests.coord_test.CoordTest)
tests.coord_test.CoordTest.test_pos_enc_20_0.2
test_pos_enc_20_0.2(20, 0.2)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/opt/conda/envs/camp_zipnerf/lib/python3.11/site-packages/absl/testing/parameterized.py", line 321, in bound_param_test
    return test_method(self, *testcase_params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/a/camp_zipnerf/tests/coord_test.py", line 305, in test_pos_enc
    self.assertLess(max_err, tol)
AssertionError: 0.23938593 not less than 0.2

----------------------------------------------------------------------
Ran 97 tests in 199.062s

FAILED (failures=2, skipped=13)
Running datasets_test.py
.
----------------------------------------------------------------------
Ran 1 test in 4.156s

OK
terminate called without an active exception
./scripts/run_all_unit_tests.sh: line 17: 70089 Aborted                 python -m unittest "$file"
Running geometry_test.py
........................
----------------------------------------------------------------------
Ran 24 tests in 4.341s

OK
Running geopoly_test.py
.........
----------------------------------------------------------------------
Ran 9 tests in 15.739s

OK
Running grid_utils_test.py
.........................................................................
----------------------------------------------------------------------
Ran 73 tests in 13.668s

OK
Running hash_resample_test.py
....
----------------------------------------------------------------------
Ran 4 tests in 2.613s

OK
Running image_utils_test.py
..........
----------------------------------------------------------------------
Ran 10 tests in 8.186s

OK
Running linspline_test.py
..s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s..
----------------------------------------------------------------------
Ran 145 tests in 15.251s

OK (skipped=29)
Running loss_utils_test.py
.......
----------------------------------------------------------------------
Ran 7 tests in 3.810s

OK
Running math_test.py
/home/a/camp_zipnerf/tests/math_test.py:46: RuntimeWarning: overflow encountered in cast
  x = np.float32(np.exp(log_x))
/home/a/camp_zipnerf/internal/math.py:340: RuntimeWarning: overflow encountered in square
  return jnp.sign(x) * jnp.sqrt(1 - jnp.exp(-(4 / jnp.pi) * x**2))
/home/a/camp_zipnerf/internal/math.py:340: RuntimeWarning: overflow encountered in multiply
  return jnp.sign(x) * jnp.sqrt(1 - jnp.exp(-(4 / jnp.pi) * x**2))
./home/a/camp_zipnerf/tests/math_test.py:46: RuntimeWarning: overflow encountered in cast
  x = np.float32(np.exp(log_x))
....s....s....s....s....s....s....s....s....s....s....s......./home/a/camp_zipnerf/tests/math_test.py:46: RuntimeWarning: overflow encountered in cast
  x = np.float32(np.exp(log_x))
./home/a/camp_zipnerf/tests/math_test.py:46: RuntimeWarning: overflow encountered in cast
  x = np.float32(np.exp(log_x))
.....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s.....s....s....s....s....s....s....s....s....s....s....s......./home/a/camp_zipnerf/tests/math_test.py:46: RuntimeWarning: overflow encountered in cast
  x = np.float32(np.exp(log_x))
...s../home/a/camp_zipnerf/tests/math_test.py:46: RuntimeWarning: overflow encountered in cast
  x = np.float32(np.exp(log_x))
./home/a/camp_zipnerf/tests/math_test.py:46: RuntimeWarning: overflow encountered in cast
  x = np.float32(np.exp(log_x))
./home/a/camp_zipnerf/tests/math_test.py:46: RuntimeWarning: overflow encountered in cast
  x = np.float32(np.exp(log_x))
/home/a/camp_zipnerf/tests/math_test.py:282: RuntimeWarning: divide by zero encountered in divide
  r = np.float32(n) / np.float32(d)
/home/a/camp_zipnerf/tests/math_test.py:282: RuntimeWarning: overflow encountered in divide
  r = np.float32(n) / np.float32(d)
/home/a/camp_zipnerf/tests/math_test.py:282: RuntimeWarning: invalid value encountered in divide
  r = np.float32(n) / np.float32(d)
/home/a/camp_zipnerf/tests/math_test.py:299: RuntimeWarning: divide by zero encountered in divide
  dn_true = scale / d
/home/a/camp_zipnerf/tests/math_test.py:299: RuntimeWarning: overflow encountered in divide
  dn_true = scale / d
/home/a/camp_zipnerf/tests/math_test.py:303: RuntimeWarning: overflow encountered in multiply
  dd_true = -scale * r / d
/home/a/camp_zipnerf/tests/math_test.py:303: RuntimeWarning: overflow encountered in divide
  dd_true = -scale * r / d
./home/a/camp_zipnerf/tests/math_test.py:46: RuntimeWarning: overflow encountered in cast
  x = np.float32(np.exp(log_x))
/home/a/camp_zipnerf/tests/math_test.py:282: RuntimeWarning: divide by zero encountered in divide
  r = np.float32(n) / np.float32(d)
/home/a/camp_zipnerf/tests/math_test.py:282: RuntimeWarning: overflow encountered in divide
  r = np.float32(n) / np.float32(d)
/home/a/camp_zipnerf/tests/math_test.py:282: RuntimeWarning: invalid value encountered in divide
  r = np.float32(n) / np.float32(d)
/home/a/camp_zipnerf/tests/math_test.py:299: RuntimeWarning: divide by zero encountered in divide
  dn_true = scale / d
/home/a/camp_zipnerf/tests/math_test.py:299: RuntimeWarning: overflow encountered in divide
  dn_true = scale / d
/home/a/camp_zipnerf/tests/math_test.py:303: RuntimeWarning: overflow encountered in multiply
  dd_true = -scale * r / d
/home/a/camp_zipnerf/tests/math_test.py:303: RuntimeWarning: overflow encountered in divide
  dd_true = -scale * r / d
.s/home/a/camp_zipnerf/tests/math_test.py:46: RuntimeWarning: overflow encountered in cast
  x = np.float32(np.exp(log_x))
/home/a/camp_zipnerf/tests/math_test.py:282: RuntimeWarning: divide by zero encountered in divide
  r = np.float32(n) / np.float32(d)
/home/a/camp_zipnerf/tests/math_test.py:282: RuntimeWarning: overflow encountered in divide
  r = np.float32(n) / np.float32(d)
/home/a/camp_zipnerf/tests/math_test.py:282: RuntimeWarning: invalid value encountered in divide
  r = np.float32(n) / np.float32(d)
...../home/a/camp_zipnerf/tests/math_test.py:46: RuntimeWarning: overflow encountered in cast
  x = np.float32(np.exp(log_x))
.../home/a/camp_zipnerf/tests/math_test.py:46: RuntimeWarning: overflow encountered in cast
  x = np.float32(np.exp(log_x))
./home/a/camp_zipnerf/tests/math_test.py:46: RuntimeWarning: overflow encountered in cast
  x = np.float32(np.exp(log_x))
....
----------------------------------------------------------------------
Ran 247 tests in 23.489s

OK (skipped=43)
Running quaternion_test.py
.......................................................................................................................................
----------------------------------------------------------------------
Ran 135 tests in 5.985s

OK
Running ref_utils_test.py
/home/a/camp_zipnerf/tests/ref_utils_test.py:89: RuntimeWarning: invalid value encountered in divide
  grad_true = (xyz[:, 1] ** 2 + xyz[:, 2] ** 2) / (scale * denom**3)
./home/a/camp_zipnerf/tests/ref_utils_test.py:89: RuntimeWarning: invalid value encountered in divide
  grad_true = (xyz[:, 1] ** 2 + xyz[:, 2] ** 2) / (scale * denom**3)
.s.../home/a/camp_zipnerf/tests/ref_utils_test.py:89: RuntimeWarning: invalid value encountered in divide
  grad_true = (xyz[:, 1] ** 2 + xyz[:, 2] ** 2) / (scale * denom**3)
.s.../home/a/camp_zipnerf/tests/ref_utils_test.py:89: RuntimeWarning: invalid value encountered in divide
  grad_true = (xyz[:, 1] ** 2 + xyz[:, 2] ** 2) / (scale * denom**3)
.s.../home/a/camp_zipnerf/tests/ref_utils_test.py:89: RuntimeWarning: invalid value encountered in divide
  grad_true = (xyz[:, 1] ** 2 + xyz[:, 2] ** 2) / (scale * denom**3)
.s.../home/a/camp_zipnerf/tests/ref_utils_test.py:89: RuntimeWarning: invalid value encountered in divide
  grad_true = (xyz[:, 1] ** 2 + xyz[:, 2] ** 2) / (scale * denom**3)
.s.../home/a/camp_zipnerf/tests/ref_utils_test.py:89: RuntimeWarning: invalid value encountered in divide
  grad_true = (xyz[:, 1] ** 2 + xyz[:, 2] ** 2) / (scale * denom**3)
.s.../home/a/camp_zipnerf/tests/ref_utils_test.py:89: RuntimeWarning: invalid value encountered in divide
  grad_true = (xyz[:, 1] ** 2 + xyz[:, 2] ** 2) / (scale * denom**3)
.s.../home/a/camp_zipnerf/tests/ref_utils_test.py:89: RuntimeWarning: invalid value encountered in divide
  grad_true = (xyz[:, 1] ** 2 + xyz[:, 2] ** 2) / (scale * denom**3)
.s.../home/a/camp_zipnerf/tests/ref_utils_test.py:89: RuntimeWarning: invalid value encountered in divide
  grad_true = (xyz[:, 1] ** 2 + xyz[:, 2] ** 2) / (scale * denom**3)
.s.../home/a/camp_zipnerf/tests/ref_utils_test.py:89: RuntimeWarning: invalid value encountered in divide
  grad_true = (xyz[:, 1] ** 2 + xyz[:, 2] ** 2) / (scale * denom**3)
.s.../home/a/camp_zipnerf/tests/ref_utils_test.py:89: RuntimeWarning: invalid value encountered in divide
  grad_true = (xyz[:, 1] ** 2 + xyz[:, 2] ** 2) / (scale * denom**3)
.s.../home/a/camp_zipnerf/tests/ref_utils_test.py:89: RuntimeWarning: invalid value encountered in divide
  grad_true = (xyz[:, 1] ** 2 + xyz[:, 2] ** 2) / (scale * denom**3)
.s.../home/a/camp_zipnerf/tests/ref_utils_test.py:89: RuntimeWarning: invalid value encountered in divide
  grad_true = (xyz[:, 1] ** 2 + xyz[:, 2] ** 2) / (scale * denom**3)
.s.../home/a/camp_zipnerf/tests/ref_utils_test.py:89: RuntimeWarning: invalid value encountered in divide
  grad_true = (xyz[:, 1] ** 2 + xyz[:, 2] ** 2) / (scale * denom**3)
.s.../home/a/camp_zipnerf/tests/ref_utils_test.py:89: RuntimeWarning: invalid value encountered in divide
  grad_true = (xyz[:, 1] ** 2 + xyz[:, 2] ** 2) / (scale * denom**3)
.s.../home/a/camp_zipnerf/tests/ref_utils_test.py:89: RuntimeWarning: invalid value encountered in divide
  grad_true = (xyz[:, 1] ** 2 + xyz[:, 2] ** 2) / (scale * denom**3)
.s.../home/a/camp_zipnerf/tests/ref_utils_test.py:89: RuntimeWarning: invalid value encountered in divide
  grad_true = (xyz[:, 1] ** 2 + xyz[:, 2] ** 2) / (scale * denom**3)
.s.../home/a/camp_zipnerf/tests/ref_utils_test.py:89: RuntimeWarning: invalid value encountered in divide
  grad_true = (xyz[:, 1] ** 2 + xyz[:, 2] ** 2) / (scale * denom**3)
.s.../home/a/camp_zipnerf/tests/ref_utils_test.py:89: RuntimeWarning: invalid value encountered in divide
  grad_true = (xyz[:, 1] ** 2 + xyz[:, 2] ** 2) / (scale * denom**3)
.s.../home/a/camp_zipnerf/tests/ref_utils_test.py:89: RuntimeWarning: invalid value encountered in divide
  grad_true = (xyz[:, 1] ** 2 + xyz[:, 2] ** 2) / (scale * denom**3)
.s.../home/a/camp_zipnerf/tests/ref_utils_test.py:89: RuntimeWarning: invalid value encountered in divide
  grad_true = (xyz[:, 1] ** 2 + xyz[:, 2] ** 2) / (scale * denom**3)
.s.../home/a/camp_zipnerf/tests/ref_utils_test.py:89: RuntimeWarning: invalid value encountered in divide
  grad_true = (xyz[:, 1] ** 2 + xyz[:, 2] ** 2) / (scale * denom**3)
.s.../home/a/camp_zipnerf/tests/ref_utils_test.py:89: RuntimeWarning: invalid value encountered in divide
  grad_true = (xyz[:, 1] ** 2 + xyz[:, 2] ** 2) / (scale * denom**3)
.s.../home/a/camp_zipnerf/tests/ref_utils_test.py:89: RuntimeWarning: invalid value encountered in divide
  grad_true = (xyz[:, 1] ** 2 + xyz[:, 2] ** 2) / (scale * denom**3)
.s.../home/a/camp_zipnerf/tests/ref_utils_test.py:89: RuntimeWarning: invalid value encountered in divide
  grad_true = (xyz[:, 1] ** 2 + xyz[:, 2] ** 2) / (scale * denom**3)
.s.../home/a/camp_zipnerf/tests/ref_utils_test.py:89: RuntimeWarning: invalid value encountered in divide
  grad_true = (xyz[:, 1] ** 2 + xyz[:, 2] ** 2) / (scale * denom**3)
.s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s../home/a/camp_zipnerf/tests/ref_utils_test.py:68: RuntimeWarning: invalid value encountered in divide
  xyz / np.sqrt(np.sum(xyz**2, axis=-1, keepdims=True))
..s/home/a/camp_zipnerf/tests/ref_utils_test.py:68: RuntimeWarning: invalid value encountered in divide
  xyz / np.sqrt(np.sum(xyz**2, axis=-1, keepdims=True))
....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s....s..........
----------------------------------------------------------------------
Ran 648 tests in 25.003s

OK (skipped=128)
Running render_test.py
..............................................................
----------------------------------------------------------------------
Ran 62 tests in 47.985s

OK
Running resample_test.py
....../home/a/camp_zipnerf/internal/resample.py:128: UserWarning: Explicitly requested dtype float64 requested in zeros is not available, and will be truncated to dtype float32. To enable more dtypes, set the jax_enable_x64 configuration option or the JAX_ENABLE_X64 shell environment variable. See https://github.com/google/jax#current-gotchas for more.
  output = jnp.zeros((*locations.shape[:-1], data.shape[-1]), dtype=data.dtype)
/opt/conda/envs/camp_zipnerf/lib/python3.11/site-packages/jax/_src/numpy/array_methods.py:66: UserWarning: Explicitly requested dtype float64 requested in astype is not available, and will be truncated to dtype float32. To enable more dtypes, set the jax_enable_x64 configuration option or the JAX_ENABLE_X64 shell environment variable. See https://github.com/google/jax#current-gotchas for more.
  return lax_numpy.astype(arr, dtype)
........
----------------------------------------------------------------------
Ran 14 tests in 9.194s

OK
Running rigid_body_test.py
..........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
----------------------------------------------------------------------
Ran 522 tests in 21.137s

OK
Running spin_math_test.py
........................................................................................................................................................................................................................................................................................................................................
----------------------------------------------------------------------
Ran 328 tests in 21.759s

OK
Running stepfun_test.py
...................................................................
----------------------------------------------------------------------
Ran 67 tests in 60.031s

OK
Running train_utils_test.py
..
----------------------------------------------------------------------
Ran 2 tests in 1.513s

OK
Running utils_test.py
.......
----------------------------------------------------------------------
Ran 7 tests in 4.942s

OK
(camp_zipnerf) a@test-nerf-server:~/camp_zipnerf$ 

This is my machine:

(camp_zipnerf) a@test-nerf-server:~/camp_zipnerf$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2022 NVIDIA Corporation
Built on Wed_Sep_21_10:33:58_PDT_2022
Cuda compilation tools, release 11.8, V11.8.89
Build cuda_11.8.r11.8/compiler.31833905_0

Can you tell the reason for this failure and will this effect the final result?

@BATspock BATspock changed the title Failing or Skipping Tests Failing or Skipping Unit Tests Mar 21, 2024
@s1eeveW
Copy link

s1eeveW commented May 21, 2024

@BATspock Hi mate, have you solved the issue?

@sumanttyagi
Copy link

@jonbarron still this issue persist any fix ? should we ignore this

@jonbarron
Copy link
Owner

I don't know, I can't reproduce it. I expect this isn't a problem and is just something slightly exceeding a tolerance somewhere due to numerical issues of one particular hardware platform, I wouldn't sweat it.

@sumanttyagi
Copy link

@jonbarron can install this repo on the env of multi-nerf is that fine ?

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

4 participants