This repository has been archived by the owner on Feb 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 79
NIMA (MobileNetV2 architecture) - ONNX 2 CoreML fails #337
Comments
Hi, Yes it would be great if you can provide the saved .onnx model as well. Thanks! |
NIMA_Aesthetics.proto https://drive.google.com/file/d/1By-J2aiz9oDYKcq32x8Uxkb0IVyqGqx-/view?usp=sharing |
It works for me when I try to convert from the top of the master branch (https://github.com/onnx/onnx-coreml#install-from-source):
|
It worked! Thanks! |
@aseemw is it possible to change input and output names? For example, for this model, we will have names given by indexes or so. cheers |
Yes, its mentioned in the README
|
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi
i'm in the process of converting NIMA based on MobileNetV2 architecture (pytorch) model to CoreML (model can be found here https://modelzoo.co/model/nima).
Did manage to export model from PyTorch to ONNX. Now from ONNX to CoreML is giving the error listed bellow.
Did install from source (1.1.1).
tkx
p.s.: If it helps i can also send onnx file.
Source
import onnx
from onnx_coreml import convert
onnx_model = onnx.load('NIMA_Aesthetics.proto')
mlmodel = convert(onnx_model)
mlmodel.save("NIMA_Aesthetics.mlmodel")
Traceback (most recent call last):
File "", line 1, in
runfile('/xxx/.spyder/NIMA_ONNX2CoreML.py', wdir='/xxx/.spyder')
File "/anaconda2/envs/Pytorch2CoreML/lib/python2.7/site-packages/spyder_kernels/customize/spydercustomize.py", line 668, in runfile
execfile(filename, namespace)
File "/anaconda2/envs/Pytorch2CoreML/lib/python2.7/site-packages/spyder_kernels/customize/spydercustomize.py", line 100, in execfile
builtins.execfile(filename, *where)
File "NIMA_ONNX2CoreML.py", line 10, in
mlmodel = convert(onnx_model)
File "/anaconda2/envs/Pytorch2CoreML/lib/python2.7/site-packages/onnx_coreml/converter.py", line 325, in convert
graph = _prepare_onnx_graph(onnx_model.graph, transformers)
File "/anaconda2/envs/Pytorch2CoreML/lib/python2.7/site-packages/onnx_coreml/converter.py", line 245, in prepare_onnx_graph
graph = Graph.from_onnx(graph)
File "/anaconda2/envs/Pytorch2CoreML/lib/python2.7/site-packages/onnx_coreml/_graph.py", line 185, in from_onnx
t.name: numpy_helper.to_array(t) for t in graph.initializer
AttributeError: 'NoneType' object has no attribute 'initializer'
The text was updated successfully, but these errors were encountered: