mzucker / noteshrink

Convert scans of handwritten notes to beautiful, compact PDFs
https://mzucker.github.io/2016/09/20/noteshrink.html
MIT License
4.81k stars 351 forks source link

ValueError: a must be greater than 0 unless no samples are taken #43

Open VaskMykola opened 3 years ago

VaskMykola commented 3 years ago

Ive got this error: Traceback (most recent call last): File "E:\projects\noteshrink\noteshrink.py", line 590, in main() File "E:\projects\noteshrink\noteshrink.py", line 586, in main notescan_main(options=get_argument_parser().parse_args()) File "E:\projects\noteshrink\noteshrink.py", line 561, in notescan_main palette = get_palette(samples, options) File "E:\projects\noteshrink\noteshrink.py", line 387, in getpalette centers, = kmeans(samples[fg_mask].astype(np.float32), File "C:\Users\bebag\AppData\Local\Programs\Python\Python39\lib\site-packages\scipy\cluster\vq.py", line 454, in kmeans guess = _kpoints(obs, k) File "C:\Users\bebag\AppData\Local\Programs\Python\Python39\lib\site-packages\scipy\cluster\vq.py", line 480, in _kpoints idx = np.random.choice(data.shape[0], size=k, replace=False) File "mtrand.pyx", line 902, in numpy.random.mtrand.RandomState.choice ValueError: a must be greater than 0 unless no samples are taken`