# Got error msg while applying MedSam2

**URL:** <https://discourse.slicer.org/t/got-error-msg-while-applying-medsam2/45862>\
**Category:** Support\
**Created:** [January 22, 2026, 1:04pm UTC](https://discourse.slicer.org/t/got-error-msg-while-applying-medsam2/45862 "2026-01-22T13:04:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![aiden.zhu](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/aiden.zhu/32/67145_2.png) [@aiden.zhu](https://discourse.slicer.org/u/aiden.zhu)\
**Post date:** [January 22, 2026, 1:04pm UTC](https://discourse.slicer.org/t/got-error-msg-while-applying-medsam2/45862/1 "2026-01-22T13:04:40Z")

</div>

Operating system: windows  
Slicer version: 5.11.0-2026-01-19  
Expected behavior: no errors  
Actual behavior: errors with pickling

Hi all,

Trying to work with MedSam2 and got the following error while clicking on “ **Segment Middle Slice** ” button.

“Traceback (most recent call last):

File “C:\Slicer.5.10.0\3D Slicer 5.11.0-2026-01-19\lib\Python\Lib\site-packages\numpy\lib\_npyio\_impl.py”, line 494, in load

return pickle.load(fid, \*\*pickle\_kwargs)

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

\_pickle.UnpicklingError: invalid load key, ‘\<’.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):

File “C:/Slicer.5.10.0/MedSAMSlicer-MedSAM2/MedSAMSlicer-MedSAM2/slicer/MedSAM2/MedSAM2/MedSAM2.py”, line 618, in getMiddleMask

segmentation\_mask = np.load(result\_path, allow\_pickle=True)[‘segs’]

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File “C:\Slicer.5.10.0\3D Slicer 5.11.0-2026-01-19\lib\Python\Lib\site-packages\numpy\lib\_npyio\_impl.py”, line 496, in load

raise pickle.UnpicklingError(

\_pickle.UnpicklingError: Failed to interpret file ‘C:\\Users\\AIDENZ~1\\AppData\\Local\\Temp\\tmpgwrurd7b/result.npz’ as a pickle

“

Any suggestion or help will be well appreciated. Thanks in advance.

Aiden
