apple / coremltools

Core ML tools contain supporting tools for Core ML model conversion, editing, and validation.
https://coremltools.readme.io
BSD 3-Clause "New" or "Revised" License
4.33k stars 626 forks source link

Type of pipeline output 'vggishFeature' does not match type produced in pipeline input #665

Closed osianSmith closed 4 years ago

osianSmith commented 4 years ago

❓Question

Hello, I am trying to split a SoundAnlaysis Model however when I place it into Xcode I receive an error stating that 'vggishFeature' does not match type produced in pipeline input

This is my last layer: name: "flatten" input: "pool4_output" output: "vggishFeature" flatten { mode: CHANNEL_LAST }

Here is the code that sets the output:

output.type.multiArrayType.shape.append(0)
output.type.multiArrayType.shape.append(12288)

#sets the data type for our mutiArray feature
output.type.multiArrayType.dataType = coremltools.proto.FeatureTypes_pb2.ArrayFeatureType.ArrayDataType.FLOAT32

Could it be that I have either need to remove one more layer or is the output of this is not a vggish feature or can't CoreML know how to cope with this or is it something completely different?

Thanks a lot :)

srikris commented 4 years ago

Can you share the model here so we can reproduce it? It's hard to get to the bottom of your specific issue without more details.

osianSmith commented 4 years ago

Sure: its hosted here: www.osiansmith.com/featureExtractor.mlmodel

anilkatti commented 4 years ago

@osianSmith I have not been able to repro this issue just by dragging in the model to a sample Xcode project and compiling it. So, I assume there's more to it. Could you clarify at what stage you see this error? I see that featureExtractor.mlmodel itself is a pipeline model and vggishFeature is both the output of the pipeline and a sub-model inside pipeline.

osianSmith commented 4 years ago

Hey, The error seems to have changed now since updating Xcode - There is another error however I am going to close this issue and reopen a new one as its a substantial different error