multinerf icon indicating copy to clipboard operation
multinerf copied to clipboard

Unit test failed after upgrade jax

Open Derry-Xing opened this issue 1 year ago • 2 comments

Package Version


absl-py 1.2.0 asttokens 2.0.8 astunparse 1.6.3 backcall 0.2.0 cachetools 5.2.0 certifi 2022.6.15 charset-normalizer 2.1.1 chex 0.1.4 colorama 0.4.5 commonmark 0.9.1 cycler 0.11.0 decorator 5.1.1 dm-pix 0.3.3 dm-tree 0.1.7 etils 0.7.1 executing 1.0.0 flatbuffers 1.12 flax 0.6.0 fonttools 4.37.1 gast 0.4.0 gin-config 0.5.0 google-auth 2.11.0 google-auth-oauthlib 0.4.6 google-pasta 0.2.0 grpcio 1.48.1 h5py 3.7.0 idna 3.3 importlib-metadata 4.12.0 importlib-resources 5.9.0 ipython 8.4.0 jax 0.3.17 jaxlib 0.3.15+cuda11.cudnn82 jedi 0.18.1 keras 2.9.0 Keras-Preprocessing 1.1.2 kiwisolver 1.4.4 libclang 14.0.6 Markdown 3.4.1 MarkupSafe 2.1.1 matplotlib 3.5.3 matplotlib-inline 0.1.6 mediapy 1.1.0 msgpack 1.0.4 numpy 1.23.2 oauthlib 3.2.0 opencv-python 4.6.0.66 opt-einsum 3.3.0 optax 0.1.3 packaging 21.3 parso 0.8.3 pexpect 4.8.0 pickleshare 0.7.5 Pillow 9.2.0 pip 22.2.2 prompt-toolkit 3.0.31 protobuf 3.19.4 ptyprocess 0.7.0 pure-eval 0.2.2 pyasn1 0.4.8 pyasn1-modules 0.2.8 Pygments 2.13.0 pyparsing 3.0.9 python-dateutil 2.8.2 PyYAML 6.0 rawpy 0.17.2 requests 2.28.1 requests-oauthlib 1.3.1 rich 11.2.0 rsa 4.9 scipy 1.9.1 setuptools 63.4.1 six 1.16.0 stack-data 0.5.0 tensorboard 2.9.1 tensorboard-data-server 0.6.1 tensorboard-plugin-wit 1.8.1 tensorflow 2.9.2 tensorflow-estimator 2.9.0 tensorflow-io-gcs-filesystem 0.26.0 termcolor 1.1.0 toolz 0.12.0 traitlets 5.3.0 typing_extensions 4.3.0 urllib3 1.26.12 wcwidth 0.2.5 Werkzeug 2.2.2 wheel 0.37.1 wrapt 1.14.1 zipp 3.8.1

Ran 1 test in 2.614s

OK F...

FAIL: test_compute_sq_dist_reference (tests.geopoly_test.GeopolyTest) tests.geopoly_test.GeopolyTest.test_compute_sq_dist_reference Test against a simple reimplementation of compute_sq_dist.

Traceback (most recent call last): File "/home/comp/20481535/multinerf/tests/geopoly_test.py", line 53, in test_compute_sq_dist_reference np.testing.assert_allclose(sq_dist, sq_dist_ref, atol=1e-5, rtol=1e-5) File "/home/comp/20481535/enter/envs/multinerf/lib/python3.9/site-packages/numpy/testing/_private/utils.py", line 1527, in assert_allclose assert_array_compare(compare, actual, desired, err_msg=str(err_msg), File "/home/comp/20481535/enter/envs/multinerf/lib/python3.9/site-packages/numpy/testing/_private/utils.py", line 844, in assert_array_compare raise AssertionError(msg) AssertionError: Not equal to tolerance rtol=1e-05, atol=1e-05

Mismatched elements: 8965 / 10000 (89.7%) Max absolute difference: 0.01095963 Max relative difference: 0.00133467 x: array([[25.836046, 25.031933, 11.741873, ..., 24.258749, 27.689455, 16.63743 ], [ 9.823105, 12.732669, 13.659373, ..., 33.38259 , 29.974373,... y: array([[25.83547 , 25.03573 , 11.741478, ..., 24.258633, 27.685478, 16.636293], [ 9.822346, 12.731433, 13.661174, ..., 33.374432, 29.975821,...


Ran 4 tests in 14.529s

FAILED (failures=1) ...............................Mean Error = 0.08031821995973587, Tolerance = 0.1 .Mean Error = 0.08638736605644226, Tolerance = 0.1 .EEEE...................

ERROR: test_sample_intervals_unbiased_deterministic_bounded (tests.stepfun_test.StepFunTest) tests.stepfun_test.StepFunTest.test_sample_intervals_unbiased_deterministic_bounded test_sample_intervals_unbiased_deterministic_bounded(False, True)

Traceback (most recent call last): File "/home/comp/20481535/enter/envs/multinerf/lib/python3.9/site-packages/absl/testing/parameterized.py", line 314, in bound_param_test return test_method(self, *testcase_params) File "/home/comp/20481535/multinerf/tests/stepfun_test.py", line 551, in test_sample_intervals_unbiased ts = t[None].tile([n, 1]) AttributeError: 'DeviceArray' object has no attribute 'tile'

====================================================================== ERROR: test_sample_intervals_unbiased_deterministic_unbounded (tests.stepfun_test.StepFunTest) tests.stepfun_test.StepFunTest.test_sample_intervals_unbiased_deterministic_unbounded test_sample_intervals_unbiased_deterministic_unbounded(False, False)

Traceback (most recent call last): File "/home/comp/20481535/enter/envs/multinerf/lib/python3.9/site-packages/absl/testing/parameterized.py", line 314, in bound_param_test return test_method(self, *testcase_params) File "/home/comp/20481535/multinerf/tests/stepfun_test.py", line 551, in test_sample_intervals_unbiased ts = t[None].tile([n, 1]) AttributeError: 'DeviceArray' object has no attribute 'tile'

====================================================================== ERROR: test_sample_intervals_unbiased_random_bounded (tests.stepfun_test.StepFunTest) tests.stepfun_test.StepFunTest.test_sample_intervals_unbiased_random_bounded test_sample_intervals_unbiased_random_bounded(True, True)

Traceback (most recent call last): File "/home/comp/20481535/enter/envs/multinerf/lib/python3.9/site-packages/absl/testing/parameterized.py", line 314, in bound_param_test return test_method(self, *testcase_params) File "/home/comp/20481535/multinerf/tests/stepfun_test.py", line 551, in test_sample_intervals_unbiased ts = t[None].tile([n, 1]) AttributeError: 'DeviceArray' object has no attribute 'tile'

====================================================================== ERROR: test_sample_intervals_unbiased_random_unbounded (tests.stepfun_test.StepFunTest) tests.stepfun_test.StepFunTest.test_sample_intervals_unbiased_random_unbounded test_sample_intervals_unbiased_random_unbounded(True, False)

Traceback (most recent call last): File "/home/comp/20481535/enter/envs/multinerf/lib/python3.9/site-packages/absl/testing/parameterized.py", line 314, in bound_param_test return test_method(self, *testcase_params) File "/home/comp/20481535/multinerf/tests/stepfun_test.py", line 551, in test_sample_intervals_unbiased ts = t[None].tile([n, 1]) AttributeError: 'DeviceArray' object has no attribute 'tile'


Ran 56 tests in 104.593s

FAILED (errors=4) ............PE of degree 5 has a maximum error of 2.5369226932525635e-06 .PE of degree 10 has a maximum error of 6.4849853515625e-05 .PE of degree 15 has a maximum error of 0.002378210425376892 .PE of degree 20 has a maximum error of 0.11622805148363113 .PE of degree 25 has a maximum error of 1.999955415725708 .PE of degree 30 has a maximum error of 1.9999704360961914 ....

Ran 21 tests in 30.246s

OK ......

Ran 6 tests in 6.484s

OK ..

Ran 2 tests in 5.741s

OK .

Ran 1 test in 0.636s

OK .

Ran 1 test in 1.825s

OK ./scripts/run_all_unit_tests.sh: line 24: 418104 Aborted (core dumped) python -m unittest tests.datasets_test .......

Ran 7 tests in 14.740s

OK .........................................F

FAIL: test_rotated_conic_frustums (tests.render_test.RenderTest) tests.render_test.RenderTest.test_rotated_conic_frustums

Traceback (most recent call last): File "/home/comp/20481535/multinerf/tests/render_test.py", line 405, in test_rotated_conic_frustums np.testing.assert_allclose(rot_mean, gt_rot_mean, atol=1E-5, rtol=1E-5) File "/home/comp/20481535/enter/envs/multinerf/lib/python3.9/site-packages/numpy/testing/_private/utils.py", line 1527, in assert_allclose assert_array_compare(compare, actual, desired, err_msg=str(err_msg), File "/home/comp/20481535/enter/envs/multinerf/lib/python3.9/site-packages/numpy/testing/_private/utils.py", line 844, in assert_array_compare raise AssertionError(msg) AssertionError: Not equal to tolerance rtol=1e-05, atol=1e-05

Mismatched elements: 3 / 3 (100%) Max absolute difference: 9.743869e-05 Max relative difference: 0.00122184 x: array([[-0.07965 , 0.632656, -0.33236 ]], dtype=float32) y: array([[-0.079748, 0.632627, -0.332315]], dtype=float32)


Ran 42 tests in 40.311s

FAILED (failures=1)

Derry-Xing avatar Sep 04 '22 03:09 Derry-Xing

The unit test works in CPU version. But I need to use it on gpu

2022-09-04 12:16:34.979732: I external/org_tensorflow/tensorflow/compiler/xla/service/service.cc:173] XLA service 0x1e2ef20 initialized for platform Interpreter (this does not guarantee that XLA will be used). Devices: 2022-09-04 12:16:34.979790: I external/org_tensorflow/tensorflow/compiler/xla/service/service.cc:181] StreamExecutor device (0): Interpreter, 2022-09-04 12:16:34.992702: I external/org_tensorflow/tensorflow/compiler/xla/pjrt/tfrt_cpu_pjrt_client.cc:181] TfrtCpuClient created. 2022-09-04 12:16:34.993469: I external/org_tensorflow/tensorflow/core/tpu/tpu_initializer_helper.cc:262] Libtpu path is: libtpu.so 2022-09-04 12:16:34.994041: I external/org_tensorflow/tensorflow/stream_executor/tpu/tpu_platform_interface.cc:74] No TPU platform found. WARNING:absl:No GPU/TPU found, falling back to CPU. (Set TF_CPP_MIN_LOG_LEVEL=0 and rerun for more info.)

Derry-Xing avatar Sep 04 '22 04:09 Derry-Xing

Regarding the error "AttributeError: 'DeviceArray', the attribute 'tile'" has been removed: https://github.com/google/jax/pull/11944#issue-1340716694 consider using "jax.numpy.tile(t[None], [n, 1])" instead of "t[None].tile([n, 1])"

Yasse-28 avatar Sep 05 '22 13:09 Yasse-28