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

Cannot create ConcatV2. Missing or invalid attribute axis #70

Closed
silppuri opened this issue Aug 16, 2017 · 2 comments
Closed

Cannot create ConcatV2. Missing or invalid attribute axis #70

silppuri opened this issue Aug 16, 2017 · 2 comments

Comments

@silppuri
Copy link

I get the following error when converting the graph containing a concat node with axis int_value greater than 2.

fatal error: Cannot create ConcatV2. Missing or invalid attribute axis.: file <omited>/Pods/MetalBender/Sources/Adapters/Tensorflow/TFConverter+Mappers.swift, line 162

And the node in question from the .pbtxt:

node {
  name: "fire2/concat/concat/axis"
  op: "Const"
  attr {
    key: "dtype"
    value {
      type: DT_INT32
    }
  }
  attr {
    key: "value"
    value {
      tensor {
        dtype: DT_INT32
        tensor_shape {
        }
        int_val: 3
      }
    }
  }
}

And if I follow correctly the code it executes the LayerConverter+Mappers.swift calls the LayerSize.fromTf with the value 3. which in return is as follow:

    static func fromTF(index: Int) -> LayerSizeAxis? {
        switch index {
        case 0:
            return .w
        case 1:
            return .h
        case 2:
            return .f
        default:
            return nil
        }
    }
}

This evaluates as nil and throws an error.

Is there an error with the graph I'm trying to convert or is a bug in the Bender that it does not support concat indexes beyond axis=2 on a concat layer?

Environment:

  • Xcode 8.3.3,
  • iOS: 10.3.2,
  • SDK version: 10.3
@bryant1410
Copy link
Member

bryant1410 commented Aug 16, 2017

Bender, as it's based on MPSImage, doesn't support tensors with more than 3 dimensions. What is the shape of the input tensor of the concat?

@silppuri
Copy link
Author

Ah ok good to know! I'm totally new to the iOS development and tipping my toes around to see what fits my project and Bender seems to be a nice API for the iOS ML projects.
Are there any "hacks" to bypass the limitation of three dimensions?

The tensors to be concatenated have shapes like [64,63,128,64] and [128,63,128,64]. This is an inception fire module I'm trying to implement. (An example is of the concat operation )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants