FastSAM icon indicating copy to clipboard operation
FastSAM copied to clipboard

Errro:

Open shersoni610 opened this issue 2 years ago • 1 comments

Hello,

I am trying the mode for the first time. I get the following message on Apple M1. Can someone help? File "/Users/Projects/FastSAM/gitsrc/utils/tools.py", line 179, in fast_process img_array = np.fromstring(buf, dtype=np.uint8).reshape(rows, cols, 3) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ValueError: cannot reshape array of size 7756992 into shape (603,1072,3)

shersoni610 avatar Jun 26 '23 00:06 shersoni610

The issue you're encountering seems to be specific to macOS. Matplotlib uses a different backend renderer by default on macOS, which can cause inconsistencies with the image size. You can try using a different backend renderer to resolve this problem. Add the following line of code before plt.figure(): plt.switch_backend('TkAgg') utils/tools.py before line101

berry-ding avatar Jun 26 '23 06:06 berry-ding