noteshrink icon indicating copy to clipboard operation
noteshrink copied to clipboard

TypeError: unique() got an unexpected keyword argument 'return_counts'

Open larsga opened this issue 8 years ago • 3 comments

Tried running noteshrink on a JPEG saved from MacOS Preview, with the following result:

Larss-MacBook-Pro:shrink larsga$ noteshrink IMG_544*
opened IMG_5442.JPG
  getting palette...
Traceback (most recent call last):
  File "/usr/local/bin/noteshrink", line 9, in <module>
    load_entry_point('noteshrink==0.1.1', 'console_scripts', 'noteshrink')()
  File "/Library/Python/2.7/site-packages/noteshrink.py", line 584, in main
    notescan_main(options=get_argument_parser().parse_args())
  File "/Library/Python/2.7/site-packages/noteshrink.py", line 560, in notescan_main
    palette = get_palette(samples, options)
  File "/Library/Python/2.7/site-packages/noteshrink.py", line 383, in get_palette
    bg_color = get_bg_color(samples, 6)
  File "/Library/Python/2.7/site-packages/noteshrink.py", line 108, in get_bg_color
    unique, counts = np.unique(packed, return_counts=True)
TypeError: unique() got an unexpected keyword argument 'return_counts'

larsga avatar Feb 10 '17 13:02 larsga

return_counts has been added to unique() in numpy version 1.9.0. The problem may be caused by outdated numpy in your system. I recommend checking the version and trying to update it.

ptrhlm avatar Feb 12 '17 17:02 ptrhlm

I got this error. Updated numpy and that solved it.

loefberg avatar Mar 19 '18 10:03 loefberg

The command I used pip install numpy --upgrade

andreadellacorte avatar Mar 19 '18 12:03 andreadellacorte