tensorflow / compression

Data compression in TensorFlow
Apache License 2.0
858 stars 249 forks source link

Compression.all_tests Failed in docker container #80

Closed jsw-zorro closed 3 years ago

jsw-zorro commented 3 years ago

Hi, I am using the NVIDIA nvcr.io/nvidia/tensorflow:21.03-tf2-py3 docker image as the experiment environment. And when I start the container and uninstall the original tensorflow. And use these commands to install the required tensorflow version and tensorflow-compression version:

pip install tf-nightly==2.5.0.dev20210312 tensorflow-compression

Then I did the tensorflow_compression.all_tests and get the following errors

----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/tensorflow_compression/python/ops/padding_ops_test.py", line 58, in test_same_padding_conv
    self.assertEqual(padding[0][0], pos_inp - pos_out)
  File "/usr/lib/python3.8/unittest/case.py", line 912, in assertEqual
    assertion_func(first, second, msg=msg)
  File "/usr/lib/python3.8/unittest/case.py", line 902, in _baseAssertEqual
    if not first == second:
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

======================================================================
ERROR: test_same_padding_corr (tensorflow_compression.python.ops.padding_ops_test.PaddingOpsTest)
tensorflow_compression.python.ops.padding_ops_test.PaddingOpsTest.test_same_padding_corr
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/tensorflow_compression/python/ops/padding_ops_test.py", line 39, in test_same_padding_corr
    self.assertEqual(padding[0][0], pos_inp - pos_out)
  File "/usr/lib/python3.8/unittest/case.py", line 912, in assertEqual
    assertion_func(first, second, msg=msg)
  File "/usr/lib/python3.8/unittest/case.py", line 902, in _baseAssertEqual
    if not first == second:
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

----------------------------------------------------------------------
Ran 286 tests in 165.543s

FAILED (errors=2, skipped=29)
jonarchist commented 3 years ago

Hi @jsw-zorro, thanks for reporting this. It seems this is a bug in the unit test that only shows up when running on GPU, due to numerical inaccuracies. The commit above should fix it. You can safely ignore the problem and use TFC as intended.