hub icon indicating copy to clipboard operation
hub copied to clipboard

Coreml model is not unzipping if I download it from hub export

Open CharanPrasadK opened this issue 11 months ago • 7 comments
trafficstars

Search before asking

  • [X] I have searched the HUB issues and found no similar bug report.

HUB Component

Export

Bug

I tried to download yolo11n exported model into coreml it is downloaded as yolo11n.mlpackage.zip but its no unzipping in any os.

Environment

No response

Minimal Reproducible Example

No response

Additional

No response

CharanPrasadK avatar Dec 23 '24 10:12 CharanPrasadK

👋 Hello @CharanPrasadK, thank you for raising an issue about Ultralytics HUB 🚀! Please ensure you are following the correct steps for working with exported CoreML models. It seems like you are encountering an issue with unzipping the .mlpackage.zip file.

If this is a 🐛 Bug Report, could you provide additional details to help us reproduce the problem? Specifically, we need:

  • Screenshots or error messages you encounter during the unzipping process.
  • A minimum reproducible example (MRE), including the steps you followed to download and try unzipping the CoreML model.
  • Information about the environment you are working in, such as the operating system and any tools you are using to unzip the file.

If this is a ❓ Question, please provide more details regarding the workflow you followed, the type of model exported, and any other relevant context so we can assist better.

This is an automated response to help streamline the troubleshooting process. An Ultralytics engineer will review your issue and assist you further as soon as possible. Thank you for your patience! 😊

UltralyticsAssistant avatar Dec 23 '24 10:12 UltralyticsAssistant

@CharanPrasadK Thank you for contacting us. Please tell us more about the situation where you cannot unzip mlpackage.zip. Do you mean that you cannot unzip the zip in the first place? In that case, we can investigate the issue more quickly if you could tell us how you unzipped it (for example, by double-clicking it in macOS Finder) and provide a screenshot of the result. Or does it mean that the unzipped mlpackage is corrupted in some way? I would appreciate it if you could let me know.

john-rocky avatar Dec 23 '24 11:12 john-rocky

Thank You for reply. Yes, I downloaded coreml model from ultralytics hub it is downloaded as yolo11n.mlpackage.zip , so when im trying to unzip or double click, its not open and showing cannot unzip ..... of that sort.

CharanPrasadK avatar Dec 27 '24 02:12 CharanPrasadK

@CharanPrasadK I just tested now by training a new model in HUB and exporting to CoreML. The download will be a *.zip file that contains your CoreML model. Unzip the zip file to get your CoreML model:

Screenshot 2024-12-27 at 13 24 54

glenn-jocher avatar Dec 27 '24 12:12 glenn-jocher

Reviving this topic since I'm bumping into this issue.

I just downloaded YOLO11 from the hub website as a CoreML, which downloads a xxx.mlpackage.zip file to target folder. I tried with multiple versions of YOLO and having the same issue, where the zip after double clicking does not unzip and gives the error below: Image

I tried unzipping from the command line and it does not work either (screenshot below), it seems that the zip file is corrupted somehow. I do have a custom model trained and that downloads normally. Image

CJL89 avatar Mar 24 '25 13:03 CJL89

@CJL89 Can you try opening the file in XCode? CC @john-rocky

sergiuwaxmann avatar Mar 24 '25 15:03 sergiuwaxmann

@sergiuwaxmann, importing the zip directly in XCode treats it as a zip and does not unzip either.

Image

PS: exporting YOLO11n using the package of ultralytics (8.3.88) with the command "export model=yolo11n.pt format='coreml'" works as expected so this can be a workaround for users who have issues downloading the zip file.

CJL89 avatar Mar 24 '25 15:03 CJL89

Having the same issue(more than a year later) Thanks @CJL89, your workaround was a lifesaver! Need a proper fix of the exporter from the devs!

mentarus avatar May 13 '25 22:05 mentarus

@mentarus unzip the zip before importing into Xcode

glenn-jocher avatar May 17 '25 21:05 glenn-jocher

@CharanPrasadK @mentarus @CJL89 CoreML zips unzip correctly for me, I'm unable to reproduce any problem here for newly trained custom YOLO11 models in HUB:

https://github.com/user-attachments/assets/63b773e6-ef8c-4488-8ebc-6d4764637d79

glenn-jocher avatar May 17 '25 21:05 glenn-jocher

Meeting same issue

OS: Version 15.5 (Build 24F74) (arm64) Keka: v1.4.3-r5464 (WEB) (Sandboxed) (en) Format detected: Unknown Binary used: keka7zz Arguments: ( x, "/Users/UNAME/Downloads/yolo11x_obb.mlpackage.zip", "-snld", "-aou", "-xr!__MACOSX", "-bsp1" )

7-Zip (z) 24.07 (arm64) : Copyright (c) 1999-2024 Igor Pavlov : 2024-06-19 : Modified by aone for Keka 64-bit arm_v:8.5-A locale=en_US.UTF-8 Threads:10 OPEN_MAX:2560, ASM

Scanning the drive for archives: 0M Scan /Users/UNAME/Downloads/ 1 file, 235314253 bytes (225 MiB)

Extracting archive: /Users/UNAME/Downloads/yolo11x_obb.mlpackage.zip 3% Open ERROR: /Users/UNAME/Downloads/yolo11x_obb.mlpackage.zip /Users/UNAME/Downloads/yolo11x_obb.mlpackage.zip Open ERROR: Cannot open the file as [zip] archive

ERRORS: Is not archive

3% Can't open as archive: 1 Files: 0 Size: 0 Compressed: 0

OS: Version 15.5 (Build 24F74) (arm64) Keka: v1.4.3-r5464 (WEB) (Sandboxed) (en) Format detected: Unknown Binary used: kekaunar Arguments: ( "-q", "-r", "-D", "-K", "-nq", "-o", "/Users/UNAME/Downloads/yolo11x_obb.mlpackage.kextraction/Operation", "/Users/UNAME/Downloads/yolo11x_obb.mlpackage.zip" ) Couldn't recognize the archive format.

Error code 1

ziiip avatar Aug 02 '25 04:08 ziiip

@ziiip Thank you for the detailed error logs! This helps confirm what @CharanPrasadK, @CJL89, and @mentarus have been experiencing with corrupted CoreML zip downloads from Ultralytics HUB.

Based on the reports and error details you've all provided, it appears there's an issue with the HUB export functionality specifically for CoreML models where the .mlpackage.zip files are being corrupted during the download process. The error logs clearly show "Cannot open the file as [zip] archive" and "Is not archive", which indicates the file structure is malformed.

Immediate Workaround: As @CJL89 mentioned, you can export CoreML models directly using the Ultralytics package:

from ultralytics import YOLO

# Load your model (replace with your model path if using a custom trained model)
model = YOLO("yolo11n.pt")  # or your custom model path

# Export to CoreML
model.export(format="coreml")

This will generate a proper .mlpackage file that can be used directly in Xcode without any zip corruption issues.

For HUB-trained models: If you have a custom model trained in HUB, you can download the .pt file and then export it locally using the method above.

I'm escalating this issue internally as it appears to be a systematic problem with the HUB CoreML export download functionality. The fact that multiple users across different time periods are experiencing identical symptoms suggests this needs investigation on the server-side export generation.

Thank you all for the detailed reports and screenshots - they're extremely helpful for debugging this issue! 🛠️

pderrenger avatar Aug 02 '25 13:08 pderrenger

@ziiip Thank you for your feedback. Can you provide your model ID on HUB? We can investigate with it.

john-rocky avatar Aug 04 '25 12:08 john-rocky

@john-rocky

I'm sorry to relay at this time.

Here is the model https://hub.ultralytics.com/models/eUcl5y4Ohu92JKHsB6AV?tab=deploy, the "YOLO11s Segment"

ziiip avatar Aug 14 '25 07:08 ziiip