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

NodeDef missing attr 'shape' from Op #119

Closed
yeesian opened this issue Jan 20, 2017 · 2 comments
Closed

NodeDef missing attr 'shape' from Op #119

yeesian opened this issue Jan 20, 2017 · 2 comments

Comments

@yeesian
Copy link
Contributor

yeesian commented Jan 20, 2017

I'm getting the error message

julia> Operation(node)
ERROR: Tensorflow error: Status: NodeDef missing attr 'shape' from Op<name=Variable; signature= -> ref:Ref(dtype); attr=shape:shape; attr=dtype:type; attr=container:string,default=""; attr=shared_name:string,default=""; is_stateful=true>; NodeDef: hidden1_1/weights = Variable[_class=[], container="", dtype=DT_FLOAT, shared_name=""]()

 in check_status(::TensorFlow.Status) at /Users/yeesian/.julia/v0.5/TensorFlow/src/core.jl:95
 in TensorFlow.Operation(::TensorFlow.NodeDescription) at /Users/yeesian/.julia/v0.5/TensorFlow/src/core.jl:482
 in TensorFlow.Operation(::TensorFlow.tensorflow.NodeDef) at /Users/yeesian/.julia/v0.5/TensorFlow/src/core.jl:672

on the following object:

julia> dump(node)
TensorFlow.tensorflow.NodeDef
  name: String "hidden1_1/weights"
  op: String "Variable"
  input: Array{AbstractString}((0,))
  device: String ""
  attr: Dict{AbstractString,TensorFlow.tensorflow.AttrValue}
    slots: Array{UInt8}((16,)) UInt8[0x01,0x00,0x01,0x00,0x00,0x01,0x01,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00]
    keys: Array{AbstractString}((16,))
      1: String "dtype"
      2: #undef
      3: String "shape"
      4: #undef
      5: #undef
      ...
      12: #undef
      13: #undef
      14: #undef
      15: #undef
      16: #undef
    vals: Array{TensorFlow.tensorflow.AttrValue}((16,))
      1: TensorFlow.tensorflow.AttrValue
        s: #undef
        i: Int64 0
        f: Float32 0.0
        b: Bool false
        _type: Int32 1
        shape: #undef
        tensor: #undef
        list: #undef
        placeholder: #undef
      2: #undef
      3: TensorFlow.tensorflow.AttrValue
        s: #undef
        i: Int64 0
        f: Float32 0.0
        b: Bool false
        _type: Int32 0
        shape: TensorFlow.tensorflow.TensorShapeProto
          dim: Array{TensorFlow.tensorflow.TensorShapeProto_Dim}((2,))
            1: TensorFlow.tensorflow.TensorShapeProto_Dim
              size: Int64 28
              name: String ""
            2: TensorFlow.tensorflow.TensorShapeProto_Dim
              size: Int64 128
              name: String ""
          unknown_rank: Bool false
        tensor: #undef
        list: #undef
        placeholder: #undef
      4: #undef
      5: #undef
      ...
      12: #undef
      13: #undef
      14: #undef
      15: #undef
      16: #undef
    ndel: Int64 0
    count: Int64 5
    age: UInt64 5
    idxfloor: Int64 1
    maxprobe: Int64 0
@malmaud
Copy link
Owner

malmaud commented Jan 28, 2017

Hmm, where did that NodeDef come from? Are you sure it's actually valid? Can you link me to to the raw protobytes for it so I can examine it?

@yeesian
Copy link
Contributor Author

yeesian commented Jan 28, 2017

I'm not sure anymore, since I can't reproduce it anymore, sorry. Closing this issue for now, unless it comes up again.

The closest I've come to reproducing the same NodeDef is in this file:

  | | |_| | | | (_| |  |  Version 0.5.0 (2016-09-19 18:14 UTC)
 _/ |\__'_|_|_|\__'_|  |  Official http://julialang.org/ release
|__/                   |  x86_64-apple-darwin13.4.0

julia> using TensorFlow; const TF = TensorFlow
TensorFlow

julia> using ProtoBuf

julia> nodedef = open("nodedef.proto") do f
           readproto(f, TF.tensorflow.NodeDef())
       end
name: hidden1_1/weights
op: Variable
attr {
  key: dtype
  value {
    type: Float32
  }
}
attr {
  key: shape
  value {
    shape: [28,128]
  }
}
attr {
  key: _output_shapes
  value {
      }
}
attr {
  key: shared_name
  value {
    string:
  }
}
attr {
  key: container
  value {
    string:
  }
}


julia> dump(nodedef)
TensorFlow.tensorflow.NodeDef
  name: String "hidden1_1/weights"
  op: String "Variable"
  input: Array{AbstractString}((0,))
  device: String ""
  attr: Dict{AbstractString,TensorFlow.tensorflow.AttrValue}
    slots: Array{UInt8}((16,)) UInt8[0x01,0x00,0x01,0x00,0x00,0x01,0x01,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00]
    keys: Array{AbstractString}((16,))
      1: String "dtype"
      2: #undef
      3: String "shape"
      4: #undef
      5: #undef
      ...
      12: #undef
      13: #undef
      14: #undef
      15: #undef
      16: #undef
    vals: Array{TensorFlow.tensorflow.AttrValue}((16,))
      1: TensorFlow.tensorflow.AttrValue
        s: #undef
        i: Int64 0
        f: Float32 0.0
        b: Bool false
        _type: Int32 1
        shape: #undef
        tensor: #undef
        list: #undef
        placeholder: #undef
      2: #undef
      3: TensorFlow.tensorflow.AttrValue
        s: #undef
        i: Int64 0
        f: Float32 0.0
        b: Bool false
        _type: Int32 0
        shape: TensorFlow.tensorflow.TensorShapeProto
          dim: Array{TensorFlow.tensorflow.TensorShapeProto_Dim}((2,))
            1: TensorFlow.tensorflow.TensorShapeProto_Dim
              size: Int64 28
              name: String ""
            2: TensorFlow.tensorflow.TensorShapeProto_Dim
              size: Int64 128
              name: String ""
          unknown_rank: Bool false
        tensor: #undef
        list: #undef
        placeholder: #undef
      4: #undef
      5: #undef
      ...
      12: #undef
      13: #undef
      14: #undef
      15: #undef
      16: #undef
    ndel: Int64 0
    count: Int64 5
    age: UInt64 5
    idxfloor: Int64 1
    maxprobe: Int64 0

which now works fine for me:

julia> TF.Operation(nodedef)
<Operation 'hidden1_1/weights'>

@yeesian yeesian closed this as completed Jan 28, 2017
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