rembg icon indicating copy to clipboard operation
rembg copied to clipboard

[BUG] argmax_dispatcher() got an unexpected keyword argument 'keepdims'

Open Sherman-Liu opened this issue 2 years ago • 3 comments

Describe the bug When using rembg with -m u2net_cloth_seg option, it would give out error message “argmax_dispatcher() got an unexpected keyword argument 'keepdims'”, with no output file in the output folder.

To Reproduce Just run “rembg p inputfolder outputfolder -m u2net_cloth_seg”

Expected behavior The photo should be processed with no error.

Images Any input images would trigger error.

OS Version: Windows 10 19044.1889

Rembg version: v2.0.25

Additional context Python 3.10.7 (tags/v3.10.7:6cc6b13, Sep 5 2022, 14:08:36) [MSC v.1933 64 bit (AMD64)] on win32

Sherman-Liu avatar Sep 15 '22 07:09 Sherman-Liu

Looks like the requirements.txt is incorrect. It lists numpy==1.21.6, but 1.21.6 version of argmax doesn't have keepdims as a parameter. 1.22.0 does have it.

https://github.com/numpy/numpy/blob/v1.21.6/numpy/core/fromnumeric.py#L1122 https://github.com/numpy/numpy/blob/v1.22.0/numpy/core/fromnumeric.py#L1128

Unfortunately after upgrading to numpy 1.22.0, while rembg no longer crashes using u2net_cloth_seg, the output images for u2net_cloth_seg are broken (the other models still work fine).

brianmcdonnell avatar Sep 22 '22 18:09 brianmcdonnell

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Oct 23 '22 02:10 github-actions[bot]

Was anyone able to solve this? @brianmcdonnell @Sherman-Liu

davidfant avatar Oct 24 '22 10:10 davidfant

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Nov 25 '22 02:11 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar Dec 09 '22 02:12 github-actions[bot]