Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CoreML failing to load #234

Closed
CodeCutterUK opened this issue Aug 22, 2023 · 13 comments
Closed

CoreML failing to load #234

CodeCutterUK opened this issue Aug 22, 2023 · 13 comments

Comments

@CodeCutterUK
Copy link

When trying to load a Yolov8 model, converted to CoreML, I get this error.

compiler error: compiler error: Encountered an error while compiling a neural network model: Failed to copy weights during compilation. Error description: “weights” couldn’t be copied because you don’t have permission to access “model0”.
image

Additionally I get a "Create folder error" on app launch with the extra text "The file “settings” doesn’t exist."

It loaded the model once, so not sure it's an issue with the model.

I've attempt to remove the app and completely clear up, before reinstalling....but not sure I was able to find everything left behind.

Any suggestions?

@ryouchinsa
Copy link
Owner

Thanks for writing the issue.

When you launch RectLabel, RectLabel tries to read the settings file.
~/Library/Containers/com.waysify.roi/Data/settings_labels.json

Based on the error dialog, it might be that RectLabel does not have enough permission to read/write on your computer.

Coud you check the permission of RectLabel app?

@CodeCutterUK
Copy link
Author

Thanks for looking at this

The directory is 700 and the file is 644. Setting both to 777 makes no difference. All files/dirs owned by my user.

@ryouchinsa
Copy link
Owner

We exported the coreml model using the latest YOLOv8.
pip install ultralytics
yolo segment export model=yolov8n-seg.pt format=coreml

In our environment we could load the coreml model without an error.
Could you give us a hint to reproduce the problem in our environment?

@CodeCutterUK
Copy link
Author

That's the same command I used. Obviously have to get access to the model inside the mlpackage, so that could be the issue.

It does feel like there is a permission issue. I'd be happy to set up a time to Zoom and show you the issue if that would work for you.

@Optics
Copy link

Optics commented Sep 11, 2023

We exported the coreml model using the latest YOLOv8. pip install ultralytics yolo segment export model=yolov8n-seg.pt format=coreml

In our environment we could load the coreml model without an error. Could you give us a hint to reproduce the problem in our environment?

I do have the same problem but with a custom trained model based on yolov8 I've trained on Google Colab and export it. First I also tried to convert the ".pt" into the ".mlmodel" with no custom training that loads without any problem.

When I load the custom trained one the program directly crashes when I clicked on "auto labeling" after loading the custom trained model "best.mlmodel".

Do you have any clue what I could try and what information you need to help me?

@ryouchinsa
Copy link
Owner

Thanks for writing the issue.
Could you share the detailed situation to reproduce the problem?

In our environment, the ultralytics version is 8.0.176.
pip install -U ultralytics

Using our fish-dataset, we trained the YOLOv8 segmentation model.

yolo segment train data=fish.yaml model=yolov8n-seg.pt epochs=100 imgsz=640

And, export the best.pt to the best.mlpackage file.

yolo export model=best.pt format=coreml

スクリーンショット 2023-09-13 16 35 51

Using the latest RectLabel version 2023.09.12, we can load the best.mlpackage file and process the image to obtain the detected polygons.

スクリーンショット 2023-09-13 16 32 55

@Optics
Copy link

Optics commented Sep 13, 2023

Ah okay. I trained the model on detection instead of segmentation. Could that be a problem?

I will try it later this week with training it on segmentation.

@CodeCutterUK
Copy link
Author

CodeCutterUK commented Sep 13, 2023 via email

@Optics
Copy link

Optics commented Sep 13, 2023

I am using an M1 MacBook Air. Is Apple Silicon a problem?

@ryouchinsa
Copy link
Owner

We checked on the Apple M1 MacBook Pro device.

Using our fish-dataset-detection, we trained the YOLOv8 detection model.

yolo detect train data=fish-detection.yaml model=yolov8n.pt epochs=100 imgsz=640

And, export the best.pt to the best.mlpackage file.

yolo export model=best.pt format=coreml

スクリーンショット 2023-09-13 19 11 56

Using the latest RectLabel version 2023.09.12, we can load the best.mlpackage file and process the image to obtain the detected bounding boxes.

スクリーンショット 2023-09-13 19 08 49

@ryouchinsa
Copy link
Owner

ryouchinsa commented Sep 13, 2023

For the permission issue, could you try deleting cache files?
https://rectlabel.com/help#troubleshooting

  • The cache files path is one of the paths below.
    ~/Library/Containers/RectLabel
    ~/Library/Containers/com.waysify.roi
    ~/Library/Containers/com.waysify.roi.vpp
  • Backup the settings file "the_cache_files_path/Data/settings_labels.json".
  • Delete the cache files.
  • Clean up the trash box and launch RectLabel.

For the crash issue, could you copy and paste the crash message to this page or send an email to support@rectlabel.com?

@ryouchinsa
Copy link
Owner

The new version 2023.09.27 was released.
Fixed the crash when you run YOLOv8 models trained using except imgsz=640.

Please let us know your opinion.

@ryouchinsa
Copy link
Owner

Currently If you need our support to fix this problem, please let us know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants