question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError when fitting on >= 4096 samples

See original GitHub issue

Hi, I systematically get a TypeError when I run the fit() method on a dataset that is >=4096 samples. E.g.:

reducer = umap.UMAP() 
np.random.seed(0)
reducer.fit(np.random.rand(4096,16))

produces the error, while

reducer = umap.UMAP() 
np.random.seed(0)
reducer.fit(np.random.rand(4095,16))

runs fine.

I have installed umap with:

pip3 install umap-learn[plot]

This is the traceback of the error:

TypeError Traceback (most recent call last) <ipython-input-98-8feab5de4b07> in <module> 1 reducer = umap.UMAP(random_state=41,init=‘random’, force_approximation_algorithm=True) ----> 2 reducer.fit(np.random.rand(4096,16))

~/anaconda2/envs/ecpackage3/lib/python3.8/site-packages/umap/umap_.py in fit(self, X, y) 1831 self._search_graph.data = _data 1832 self._search_graph = self._search_graph.maximum( -> 1833 self._search_graph.transpose() 1834 ).tocsr() 1835

~/anaconda2/envs/ecpackage3/lib/python3.8/site-packages/scipy/sparse/lil.py in transpose(self, axes, copy) 435 436 def transpose(self, axes=None, copy=False): –> 437 return self.tocsr(copy=copy).transpose(axes=axes, copy=False).tolil(copy=False) 438 439 transpose.doc = spmatrix.transpose.doc

~/anaconda2/envs/ecpackage3/lib/python3.8/site-packages/scipy/sparse/lil.py in tocsr(self, copy) 460 indptr = np.empty(M + 1, dtype=idx_dtype) 461 indptr[0] = 0 –> 462 _csparsetools.lil_get_lengths(self.rows, indptr[1:]) 463 np.cumsum(indptr, out=indptr) 464 nnz = indptr[-1]

_csparsetools.pyx in scipy.sparse._csparsetools.lil_get_lengths()

~/anaconda2/envs/ecpackage3/lib/python3.8/site-packages/scipy/sparse/_csparsetools.cpython-38-darwin.so in View.MemoryView.memoryview_cwrapper()

~/anaconda2/envs/ecpackage3/lib/python3.8/site-packages/scipy/sparse/_csparsetools.cpython-38-darwin.so in View.MemoryView.memoryview.cinit()

TypeError: a bytes-like object is required, not ‘list’

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

6reactions
AndreaTacchellacommented, Jun 23, 2020

Update: after installing pynndescent the error disappeared. Not sure if it is the expected behavior though…

5reactions
lmcinnescommented, Jun 26, 2020

Should be fixed in master; I’ll try to roll up any other fixes/patches and make a release soon.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: Could not build a TypeSpec with type KerasTensor
I got this error when upgrading from tensorflow 1.2.1 to 2.4. It appears the statement "x, K.shape(input_image)[1:3]))(input_gt_boxes)" is ...
Read more >
Train models with Azure Machine Learning datasets
TypeError : FileNotFound: No such file or directory: This error occurs if the file path you provide isn't where the file is located....
Read more >
python-gnupg - Read the Docs
Install this module using pip install python-gnupg . ... In our testing, we found, for example, that the 2.1.11 executable shipped with Ubuntu...
Read more >
How to Save and Load Your Keras Deep Learning Model
The example below demonstrates this by first fitting a model, evaluating it, and saving it to the file model.h5.
Read more >
Using display.specshow — librosa 0.10.0.dev0 documentation
For the remainder of this example, we'll use the object-oriented interface. ... n_fft=4096) S_db_hr = librosa.amplitude_to_db(np.abs(D_highres), ref=np.max) ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found