-
-
Notifications
You must be signed in to change notification settings - Fork 17.2k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
🐛 Bug
I was following #251 from inside the docker container (just pulled and newly built) and it appears that coremltools
is no longer included in the docker container.
To Reproduce
Input:
root@PC:/home/username/git/yolov5# python models/export.py --weights yolov5s.pt --img 640 --batch 1
Output:
root@PC:/home/username/git/yolov5# python models/export.py --weights yolov5s.pt --img 640 --batch 1
Namespace(batch_size=1, device='cpu', dynamic=False, grid=False, img_size=[640, 640], weights='yolov5s.pt')
YOLOv5 🚀 v4.0-180-g1148e2e torch 1.9.0a0+df837d0 CPU
Fusing layers...
Model Summary: 224 layers, 7266973 parameters, 0 gradients, 17.0 GFLOPS
Starting TorchScript export with torch 1.9.0a0+df837d0...
/opt/conda/lib/python3.8/site-packages/torch/jit/_trace.py:950: TracerWarning: Encountering a list at the output of the tracer might cause the trace to be incorrect, this is only valid if the container structure does not change based on the module's inputs. Consider using a constant container instead (e.g. for `list`, use a `tuple` instead. for `dict`, use a `NamedTuple` instead). If you absolutely need this and know the side effects, pass strict=False to trace() to allow this behavior.
module._c._create_method_from_trace(
TorchScript export success, saved as yolov5s.torchscript.pt
Starting ONNX export with onnx 1.8.0...
ONNX export success, saved as yolov5s.onnx
CoreML export failure: No module named 'coremltools'
Export complete (4.34s). Visualize with https://github.com/lutzroeder/netron.
Expected behavior
I expected the CoreML export to complete successfully resulting in a yolov5s.mlmodel
file
Namespace(batch_size=1, device='cpu', dynamic=False, grid=False, img_size=[640, 640], weights='./yolov5s.pt')
Downloading https://github.com/ultralytics/yolov5/releases/download/v4.0/yolov5s.pt to yolov5s.pt...
100%|██████████| 14.1M/14.1M [00:00<00:00, 36.1MB/s]
Fusing layers...
Model Summary: 224 layers, 7266973 parameters, 0 gradients, 17.0 GFLOPS
Starting TorchScript export with torch 1.8.1...
TorchScript export success, saved as ./yolov5s.torchscript.pt
Starting ONNX export with onnx 1.8.1...
ONNX export success, saved as ./yolov5s.onnx
Starting CoreML export with coremltools 4.1...
...
CoreML export success, saved as ./yolov5s.mlmodel
Export complete (10.94s). Visualize with https://github.com/lutzroeder/netron.
Environment
Inside a freshly pulled and newly built docker image from yolov5's Dockerfile running on Ubuntu 20.04.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working