`make test` results in AssertionError at test_clustering.py, line 90 #30

Closed
shackenberg opened this Issue Feb 9, 2012 · 5 comments

Comments

Projects
None yet
3 participants
@shackenberg

Can anyone reproduce this error? I tried it on two different Ubuntu installations (both Ubuntu 10.10).

I am using version: cc0c061

~/flann/build$ make test
[  7%] Built target flann_s
[  7%] Built target flann
Scanning dependencies of target pyunit_test_clustering.py
[  7%] Running pyunit test(s) test_clustering.py
Clusters requested: 2, returning 2
Clusters requested: 2, returning 2
Clusters requested: 2, returning 2
.Clusters requested: 2, returning 2
Clusters requested: 2, returning 2
Clusters requested: 2, returning 2
.Clusters requested: 3, returning 3
Clusters requested: 3, returning 3
Clusters requested: 3, returning 3
.Clusters requested: 3, returning 3
Clusters requested: 3, returning 3
Clusters requested: 3, returning 3
.Clusters requested: 4, returning 4
Clusters requested: 4, returning 4
Clusters requested: 4, returning 4
.Clusters requested: 2, returning 2
Clusters requested: 2, returning 2
Clusters requested: 2, returning 2
.Clusters requested: 10, returning 10
.Clusters requested: 50, returning 50
Clusters requested: 50, returning 50
FClusters requested: 50, returning 50
Clusters requested: 50, returning 50
.
======================================================================
FAIL: testrandnumber_different (__main__.Test_PyFLANN_clustering)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/me/flann/test/test_clustering.py", line 90, in testrandnumber_different
    self.assert_(any(cl1 != cl2))
AssertionError

----------------------------------------------------------------------
Ran 9 tests in 0.236s

FAILED (failures=1)
make[3]: *** [test/CMakeFiles/pyunit_test_clustering.py] Error 1
make[2]: *** [test/CMakeFiles/pyunit_test_clustering.py.dir/all] Error 2
make[1]: *** [test/CMakeFiles/test.dir/rule] Error 2
make: *** [test] Error 2
@dougalsutherland

This comment has been minimized.

Show comment Hide comment
@dougalsutherland

dougalsutherland Feb 9, 2012

Contributor

I can reproduce on OSX 10.7, also using cc0c061:

[ 18%] Running pyunit test(s) test_clustering.py
.Clusters requested: 2, returning 2
Clusters requested: 2, returning 2
Clusters requested: 2, returning 2
..Clusters requested: 3, returning 3
Clusters requested: 3, returning 3
Clusters requested: 3, returning 3
.Clusters requested: 4, returning 4
Clusters requested: 4, returning 4
Clusters requested: 4, returning 4
.Clusters requested: 2, returning 2
Clusters requested: 2, returning 2
..Clusters requested: 50, returning 50
Clusters requested: 50, returning 50
FClusters requested: 50, returning 50
Clusters requested: 50, returning 50
F
======================================================================
FAIL: testrandnumber_different (__main__.Test_PyFLANN_clustering)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/dsutherl/misc/flann/test/test_clustering.py", line 90, in testrandnumber_different
    self.assert_(any(cl1 != cl2))
AssertionError: False is not True

======================================================================
FAIL: testrandomnumber_same (__main__.Test_PyFLANN_clustering)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/dsutherl/misc/flann/test/test_clustering.py", line 79, in testrandomnumber_same
    self.assert_(all(cl1 == cl2))
AssertionError: False is not True

----------------------------------------------------------------------
Ran 9 tests in 0.318s 

Sometimes only one or the other fails, but I've never gotten a complete success on it.

If I switch testrandomnumber_same to loop over the indices and use assertAlmostEqual, I sometimes get e.g.

======================================================================
FAIL: testrandomnumber_same (__main__.Test_PyFLANN_clustering)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/dsutherl/misc/flann/test/test_clustering.py", line 82, in testrandomnumber_same
    msg="cl1[%d,%d] = %g, cl2[%d,%d] = %g" % (i,j, cl1[i,j], i,j, cl2[i,j]))
AssertionError: cl1[0,0] = 0.0624973, cl2[0,0] = 0.705869

I also occasionally get a failure on test3d_large:

FAIL: test3d_large (__main__.Test_PyFLANN_clustering)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/dsutherl/misc/flann/test/test_clustering.py", line 35, in test3d_large
    self.__nd_random_clustering_test(3,3, 1000)
  File "/Users/dsutherl/misc/flann/test/test_clustering.py", line 69, in __nd_random_clustering_test
    for m in mindists: self.assertAlmostEqual(m, 0.0, 1)
AssertionError: 0.082905992688212651 != 0.0 within 1 places
Contributor

dougalsutherland commented Feb 9, 2012

I can reproduce on OSX 10.7, also using cc0c061:

[ 18%] Running pyunit test(s) test_clustering.py
.Clusters requested: 2, returning 2
Clusters requested: 2, returning 2
Clusters requested: 2, returning 2
..Clusters requested: 3, returning 3
Clusters requested: 3, returning 3
Clusters requested: 3, returning 3
.Clusters requested: 4, returning 4
Clusters requested: 4, returning 4
Clusters requested: 4, returning 4
.Clusters requested: 2, returning 2
Clusters requested: 2, returning 2
..Clusters requested: 50, returning 50
Clusters requested: 50, returning 50
FClusters requested: 50, returning 50
Clusters requested: 50, returning 50
F
======================================================================
FAIL: testrandnumber_different (__main__.Test_PyFLANN_clustering)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/dsutherl/misc/flann/test/test_clustering.py", line 90, in testrandnumber_different
    self.assert_(any(cl1 != cl2))
AssertionError: False is not True

======================================================================
FAIL: testrandomnumber_same (__main__.Test_PyFLANN_clustering)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/dsutherl/misc/flann/test/test_clustering.py", line 79, in testrandomnumber_same
    self.assert_(all(cl1 == cl2))
AssertionError: False is not True

----------------------------------------------------------------------
Ran 9 tests in 0.318s 

Sometimes only one or the other fails, but I've never gotten a complete success on it.

If I switch testrandomnumber_same to loop over the indices and use assertAlmostEqual, I sometimes get e.g.

======================================================================
FAIL: testrandomnumber_same (__main__.Test_PyFLANN_clustering)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/dsutherl/misc/flann/test/test_clustering.py", line 82, in testrandomnumber_same
    msg="cl1[%d,%d] = %g, cl2[%d,%d] = %g" % (i,j, cl1[i,j], i,j, cl2[i,j]))
AssertionError: cl1[0,0] = 0.0624973, cl2[0,0] = 0.705869

I also occasionally get a failure on test3d_large:

FAIL: test3d_large (__main__.Test_PyFLANN_clustering)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/dsutherl/misc/flann/test/test_clustering.py", line 35, in test3d_large
    self.__nd_random_clustering_test(3,3, 1000)
  File "/Users/dsutherl/misc/flann/test/test_clustering.py", line 69, in __nd_random_clustering_test
    for m in mindists: self.assertAlmostEqual(m, 0.0, 1)
AssertionError: 0.082905992688212651 != 0.0 within 1 places
@mariusmuja

This comment has been minimized.

Show comment Hide comment
@mariusmuja

mariusmuja Feb 10, 2012

Owner

I have tried on several machines and was unable to reproduce this. The test in question is verifying that different clusterings are returned for different random seeds for a set of random data. I guess it's possible (though pretty unlikely, as the data is random) the same clustering is returned for different random seeds.

Owner

mariusmuja commented Feb 10, 2012

I have tried on several machines and was unable to reproduce this. The test in question is verifying that different clusterings are returned for different random seeds for a set of random data. I guess it's possible (though pretty unlikely, as the data is random) the same clustering is returned for different random seeds.

@dougalsutherland

This comment has been minimized.

Show comment Hide comment
@dougalsutherland

dougalsutherland Feb 14, 2012

Contributor

I get this every time: as above on an OSX 10.7 machine, and consistently only testrandnumber_different on an Ubuntu VM and a Debian machine.

Any ideas for what configuration changes might be causing this?

Contributor

dougalsutherland commented Feb 14, 2012

I get this every time: as above on an OSX 10.7 machine, and consistently only testrandnumber_different on an Ubuntu VM and a Debian machine.

Any ideas for what configuration changes might be causing this?

@mariusmuja

This comment has been minimized.

Show comment Hide comment
@mariusmuja

mariusmuja Feb 16, 2012

Owner

I found the problem, should be fixed in 72140b6.

Owner

mariusmuja commented Feb 16, 2012

I found the problem, should be fixed in 72140b6.

@mariusmuja mariusmuja closed this Feb 16, 2012

@dougalsutherland

This comment has been minimized.

Show comment Hide comment
@dougalsutherland

dougalsutherland Feb 17, 2012

Contributor

Yep, those tests pass for me now.

Contributor

dougalsutherland commented Feb 17, 2012

Yep, those tests pass for me now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment