Failed convert .caffemodel to .mlmodel

Viewed 40

While trying convert caffemodel to mlmodel i cant run my converter-script.py this is my converter-script.py file :

import coremltools
caffe_model = ('oxford102.caffemodel', 'deploy.prototxt')
labels = 'flower-labels.txt'
models = coremltools.converters.caffe.converts(
   caffe_model,
   class_labels = labels,
   image_input_names = 'data'
)
coreml_model.save('FlowerClassifier.mlmodel')

i run this using virtualenv with python 2.7 and i get this error message :

File "convert-script.py", line 1, in import coremltools File "/Users/aji/Documents/Environments/python27/lib/python2.7/site-packages/coremltools/init.py", line 28, in _root_logger_handlers_backup = _root_logger.handlers.copy() AttributeError: 'list' object has no attribute 'copy'

Anyone can give me solution?

1 Answers

Use python3 instead of creating and running from a python27 venv.

python3 convert-script.py

worked for me

Related