You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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...?
The text was updated successfully, but these errors were encountered:
in travis
https://travis-ci.org/benfred/implicit/jobs/543107113#L740
I think this is because the test environment have no annoy, nmslib, and faiss
I circumbented this by adding the unittest.TestCase subclass that do nothing.
How can we do better to solve this problem...?
The text was updated successfully, but these errors were encountered: