-
Notifications
You must be signed in to change notification settings - Fork 661
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
Failed to load _MLModelProxy: No module named 'coremltools.libcoremlpython' #2350
Comments
But we still can convert model
It can works in ubuntu even |
Same problem. |
I have encountered the same problem trying to convert the DeepLabV3 to CoreML and in my case it does not work. There is also an error with the conversion of the profiler so I am unsure if the
Ubuntu 22.04, torch 2.4.0
|
What OS and version of Python are you using? |
The Btw, the error was in using
|
btw, Ubuntu 22.04 and Python 3.10 |
I just downloaded the I think you must have somehow installed using an egg, rather than a wheel, i.e. you're doing a source install rather than a binary install. You could uninstalling then running |
In my case it did not help, the issue persists. |
Can you share logs for installing coremltools in a fresh environment? |
Yes, sure!
|
Interestingly, the error does NOT occur in my macOS sequoia 15.0.1 |
@NaturalStupidlty - I thought you were probably having @LukeLIN-web - are you also using Python 3.10? |
Here is my situation: as @LukeLIN-web mentioned, even if ENV: anaconda python3.10, cuda12.1, torch2.4.0 in docker ubuntu22.04 import torch
from torchvision.models.shufflenetv2 import shufflenet_v2_x0_5
torch_model = shufflenet_v2_x0_5()
torch_model.eval()
img_batch = torch.rand(1, 3, 224, 224)
traced_model = torch.jit.trace(torch_model, img_batch)
import coremltools as ct
model = ct.convert(
traced_model,
source='pytorch',
convert_to='neuralnetwork',
inputs=[ct.TensorType(shape=img_batch.shape)])
model.save("newmodel.mlmodel") coremltools==8.1 Failed to load _MLModelProxy: No module named 'coremltools.libcoremlpython'
Failed to load _MLModelAssetProxy: No module named 'coremltools.libcoremlpython'
Failed to load _MLModelProxy: No module named 'coremltools.libcoremlpython'
Failed to load _MLCPUComputeDeviceProxy: No module named 'coremltools.libcoremlpython'
Failed to load _MLGPUComputeDeviceProxy: No module named 'coremltools.libcoremlpython'
Failed to load _MLNeuralEngineComputeDeviceProxy: No module named 'coremltools.libcoremlpython'
Failed to load _MLModelProxy: No module named 'coremltools.libcoremlpython'
Failed to load _MLComputePlanProxy: No module named 'coremltools.libcoremlpython'
Converting PyTorch Frontend ==> MIL Ops: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▊| 689/690 [00:00<00:00, 3113.27 ops/s]
Running MIL frontend_pytorch pipeline: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 5/5 [00:00<00:00, 73.19 passes/s]
Running MIL default pipeline: 9%|█████████████▉ | 8/87 [00:00<00:00, 79.23 passes/s]/root/miniconda3/envs/monai/lib/python3.10/site-packages/coremltools/converters/mil/mil/passes/defs/preprocess.py:245: UserWarning: Input, 'x.1', of the source model, has been renamed to 'x_1' in the Core ML model.
warnings.warn(msg.format(var.name, new_name))
Running MIL default pipeline: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 87/87 [00:01<00:00, 71.02 passes/s]
Running MIL backend_neuralnetwork pipeline: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 9/9 [00:00<00:00, 129.26 passes/s]
Translating MIL ==> NeuralNetwork Ops: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 584/584 [00:00<00:00, 2721.16 ops/s] coremltools==8.0 Failed to load _MLModelProxy: No module named 'coremltools.libcoremlpython'
Converting PyTorch Frontend ==> MIL Ops: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▊| 689/690 [00:00<00:00, 2922.50 ops/s]
Running MIL frontend_pytorch pipeline: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 5/5 [00:00<00:00, 70.35 passes/s]
Running MIL default pipeline: 9%|██████████████ | 8/86 [00:00<00:01, 74.96 passes/s]/root/miniconda3/envs/monai/lib/python3.10/site-packages/coremltools/converters/mil/mil/passes/defs/preprocess.py:245: UserWarning: Input, 'x.1', of the source model, has been renamed to 'x_1' in the Core ML model.
warnings.warn(msg.format(var.name, new_name))
Running MIL default pipeline: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 86/86 [00:01<00:00, 64.69 passes/s]
Running MIL backend_neuralnetwork pipeline: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 9/9 [00:00<00:00, 118.99 passes/s]
Translating MIL ==> NeuralNetwork Ops: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 584/584 [00:00<00:00, 2675.91 ops/s] Update@TobyRoseman Hi,
|
🐞Describing the bug
Stack Trace
To Reproduce
System environment (please complete the following information):
Additional context
The text was updated successfully, but these errors were encountered: