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

pytest Error: tests/test_lkm.py:81: AssertionError #4

Closed
3dsf opened this issue Feb 9, 2020 · 5 comments
Closed

pytest Error: tests/test_lkm.py:81: AssertionError #4

3dsf opened this issue Feb 9, 2020 · 5 comments

Comments

@3dsf
Copy link

3dsf commented Feb 9, 2020

=== warnings summary ===

tests/test_foreground.py::test_foreground
/home/ferg/git/pymatting/tests/test_foreground.py:31: UserWarning: Tests for GPU implementation skipped, because of missing packages.

I'm on Fedora 31 and here are my pip 3 package versions which above the required dependencies.

Requirement already satisfied: numpy in /usr/lib64/python3.7/site-packages (1.17.4)
Requirement already satisfied: pillow in /usr/lib64/python3.7/site-packages (6.1.0)
Requirement already satisfied: numba in /home/ferg/.local/lib/python3.7/site-packages (0.48.0)
Requirement already satisfied: scipy in /home/ferg/.local/lib/python3.7/site-packages (1.4.1)

@3dsf
Copy link
Author

3dsf commented Feb 9, 2020

Not on a nvidia gpu; is this the issue?

@99991
Copy link
Collaborator

99991 commented Feb 10, 2020

The warning is because no NVIDIA GPU is available, but that is only required for GPU-accelerated foreground estimation with CUDA. You can still use the CPU-implementation. And if you are lucky and can install pyopencl, you can also use the GPU-accelerated OpenCL implementation.

EDIT: The command pip3 install -r requirements_gpu.txt will install the GPU-requirements.

However, the assertion is unrelated to that.

We found a system to reproduce the issue. Which hardware are you using? Maybe there is a common denominator here.

The good news is that the error is only 5.6e-4 when it should be less than 1e-5, so it is still very small and nothing to be concerned about. We have ruled out the matrix inversion and the box filter so far as sources of numerical precision issues.

@liyiying233
Copy link

There are some problems at runtime in ubuntu16.04
`================================================================================ test session starts =================================================================================
platform linux -- Python 3.6.4, pytest-5.3.5, py-1.8.1, pluggy-0.13.1
rootdir: /home/liyiying/liyiying/git-project/pymatting
collected 11 items

tests/test_boxfilter.py . [ 9%]
tests/test_cg.py . [ 18%]
tests/test_estimate_alpha.py . [ 27%]
tests/test_foreground.py . [ 36%]
tests/test_ichol.py . [ 45%]
tests/test_kdtree.py . [ 54%]
tests/test_laplacians.py . [ 63%]
tests/test_lkm.py F [ 72%]
tests/test_preconditioners.py . [ 81%]
tests/test_simple_api.py . [ 90%]
tests/test_util.py . [100%]

`

`> assert difference < 1e-5
E assert 5.6514436094818936e-05 < 1e-05

tests/test_lkm.py:56: AssertionError
`

@99991
Copy link
Collaborator

99991 commented Apr 2, 2020

We have recently increased the threshold by a small amount. Do the tests pass now?

@99991
Copy link
Collaborator

99991 commented Oct 29, 2020

Since there have not been any comments, I'll assume that this issue has been solved.

@99991 99991 closed this as completed Oct 29, 2020
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

3 participants