Coremltools: Input shapes (height and width dimensions) must be equal for layer

Created on 13 Oct 2017  路  4Comments  路  Source: apple/coremltools

In my convolutional network, when I attempt to concat (function builder.add_elementwise) two convolutional layers (function builder.add_convolutional); one being a deconv layer and the other a conv layer, I get the error Input shapes (height and width dimensions) must be equal for layer: 'upcnv7_concat'.

Is there anyway to check the shapes of each layer within the NeuralNetworkBuilder object?

question

All 4 comments

I solved my error, but the question still stands.

Hi! Have you tried using the graph visualization util (coremltools.models.utils.visualize_spec()) ? It has an option to show the shapes of all the blobs in the graph.

The NeuralNetworkBuilder itself does not currently have shape checking capability. However, as mentioned by @aseemw you can use the graph visualization tools to check the network architecture and shape:
coremltools.models.utils.visualize_spec(builder.spec)

Awesome, thanks guys

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mushipand picture mushipand  路  5Comments

skymaze picture skymaze  路  5Comments

G-mel picture G-mel  路  5Comments

haifengkao picture haifengkao  路  4Comments

DanWBR picture DanWBR  路  4Comments