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

Product of input blob dimensions C,H,W (96,3448,1) must be equal to the parameter 'inputChannels' (96) #389

Closed
Mahanotrahul opened this issue Jun 24, 2019 · 2 comments
Labels
NN backend only Affects only the NN backend (not MIL backend) tf2.x / tf.keras Issue could be related to tf2.x where coremltools isn't supported (component)

Comments

@Mahanotrahul
Copy link
Contributor

Mahanotrahul commented Jun 24, 2019

I have converted a tensorflow frozen model using tfcoreml converter to mlmodel format. However, while loading the model for prediction
model = MLModel('file.mlmodel')
the error shown is this -

RuntimeWarning: You will not be able to run predict() on this Core ML model. 
Underlying exception message was: Error compiling model: "compiler error:  
Inner product layer: 'decoder/MatMul_34' : Product of input blob 
dimensions C,H,W (96,3448,1) must be equal to the parameter 'inputChannels' (96)

I am using Python2.7 (outside venv)
coremltools 3.0b1
MacOS 10.14.4

I am unable to understand the problem here.
In python3.7, the model loads successfully without any error. However, there calling predict on the model generates this issue #317 #372.

Exception: Unable to load CoreML.framework. Cannot make predictions.

How do I solve this issue?
Thanks!

@aseemw
Copy link
Collaborator

aseemw commented Jul 2, 2019

Seems like the model is invalid. Can you share the model? You can also file a bug report and attach the model to it.

@slin07
Copy link
Contributor

slin07 commented Jul 2, 2019

In the tfcoreml conversion did you add use_coreml_3=True?

import tfcoreml as tf_converter
tf_converter.convert(tf_model_path = 'my_model.pb',
                     mlmodel_path = 'my_model.mlmodel',
                     output_feature_names = ['softmax'],
                     input_name_shape_dict = {'input' : [1, 227, 227, 3]},
                     use_coreml_3 = True)

@srikris srikris added NN backend only Affects only the NN backend (not MIL backend) tf2.x / tf.keras Issue could be related to tf2.x where coremltools isn't supported (component) labels Dec 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NN backend only Affects only the NN backend (not MIL backend) tf2.x / tf.keras Issue could be related to tf2.x where coremltools isn't supported (component)
Projects
None yet
Development

No branches or pull requests

4 participants