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

Error at travis CI #214

Closed
ita9naiwa opened this issue Jun 8, 2019 · 4 comments
Closed

Error at travis CI #214

ita9naiwa opened this issue Jun 8, 2019 · 4 comments

Comments

@ita9naiwa
Copy link
Collaborator

ita9naiwa commented Jun 8, 2019

  1. Cannot find approximate_als_test
    in travis
    https://travis-ci.org/benfred/implicit/jobs/543107113#L740
    return self.loadTestsFromModule(obj)
  File "/home/travis/virtualenv/python2.7.14/lib/python2.7/site-packages/setuptools/command/test.py", line 52, in loadTestsFromModule
    tests.append(self.loadTestsFromName(submodule))
  File "/opt/python/2.7.14/lib/python2.7/unittest/loader.py", line 100, in loadTestsFromName
    parent, obj = obj, getattr(obj, part)
AttributeError: 'module' object has no attribute 'approximate_als_test'
The command "$PY setup.py test" exited with 1.
cache.2
store build cache

I think this is because the test environment have no annoy, nmslib, and faiss

try:
    import annoy  # noqa

    class AnnoyALSTest(unittest.TestCase, TestRecommenderBaseMixin):
        def _get_model(self):
            return AnnoyAlternatingLeastSquares(factors=2, regularization=0, use_gpu=False)
except ImportError:
    pass

try:
    import nmslib  # noqa

    class NMSLibALSTest(unittest.TestCase, TestRecommenderBaseMixin):
        def _get_model(self):
            return NMSLibAlternatingLeastSquares(factors=2, regularization=0,
                                                 index_params={'post': 2}, use_gpu=False)
except ImportError:
    pass

try:
    import faiss  # noqa

    class FaissALSTest(unittest.TestCase, TestRecommenderBaseMixin):
        def _get_model(self):
            return FaissAlternatingLeastSquares(nlist=1, nprobe=1, factors=2, regularization=0,
                                                use_gpu=False)

    if HAS_CUDA:
        class FaissALSGPUTest(unittest.TestCase, TestRecommenderBaseMixin):
            __regularization = 0

            def _get_model(self):
                return FaissAlternatingLeastSquares(nlist=1, nprobe=1, factors=32,
                                                    regularization=self.__regularization,
                                                    use_gpu=True)

            def test_similar_items(self):
                # For the GPU version, we currently have to have factors be a multiple of 32
                # (limitation that I think is caused by how we are currently calculating the
                # dot product in CUDA, TODO: eventually should fix that code).
                # this causes the test_similar_items call to fail if we set regularization to 0
                self.__regularization = 1.0
                try:
                    super(FaissALSGPUTest, self).test_similar_items()
                finally:
                    self.__regularization = 0.0

            def test_large_recommend(self):
                # the GPU version of FAISS can't return more than 1K result (and will assert/exit)
                # this tests out that we fall back in this case to the exact version and don't die
                plays = self.get_checker_board(2048)
                model = self._get_model()
                model.fit(plays, show_progress=False)

                recs = model.similar_items(0, N=1050)
                self.assertEqual(recs[0][0], 0)

                recs = model.recommend(0, plays.T.tocsr(), N=1050)
                self.assertEqual(recs[0][0], 0)

except ImportError:
    pass

I circumbented this by adding the unittest.TestCase subclass that do nothing.

class DoNothingTest(unittest.TestCase):
    # it's because build error
    def test_nothing(self):
        pass

How can we do better to solve this problem...?

@ita9naiwa
Copy link
Collaborator Author

  1. isort failed
$ isort -c **/*.py
ERROR: /home/travis/build/benfred/implicit/benchmarks/benchmark_als.py Imports are incorrectly sorted.
ERROR: /home/travis/build/benfred/implicit/benchmarks/benchmark_spark.py Imports are incorrectly sorted.
The command "isort -c **/*.py" exited with 1.

It works correctly when tested my local PC, but failed.
I think it seems the version of isort.

@ita9naiwa
Copy link
Collaborator Author

  1. Re-installation of Numpy

#180 Solved.

@ita9naiwa
Copy link
Collaborator Author

2 solved.
#217

@ita9naiwa
Copy link
Collaborator Author

  1. solved
    Fix Travis build Error #219

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

No branches or pull requests

1 participant