eaplatanios / tensorflow_scala

TensorFlow API for the Scala Programming Language
http://platanios.org/tensorflow_scala/
Apache License 2.0
936 stars 95 forks source link

Insert regression with commit 8051664, can not restore anymore a graph from protobuf #97

Closed lucataglia closed 6 years ago

lucataglia commented 6 years ago

In the commit 8051664 I see that in the fromProto method the graphElement is taken adding the handle.op.name to the /Read/ReadVariable:0 String. But restoring the graph the name in the protobuf is:

node {
    name: "foo_weights_w/Read/ReadVariableOp"     < - - - - - - - - - - - - - - - -
    op: "ReadVariableOp"
    input: "foo_weights_w"
    device: "/device:CPU:0"
    attr {
      key: "dtype"
      value {
        type: DT_DOUBLE
      }
    }
    attr {
      key: "_class"
      value {
        list {
          s: "loc:@foo_weights_w"
        }
      }
    }
    attr {
      key: "_output_shapes"
      value {
        list {
          shape {
            dim {
              size: 1
            }
            dim {
              size: 1
            }
          }
        }
      }
    }
  }

So I wondering if the /Read/ReadVariable:0 String shuldn't be /Read/ReadVariableOp:0 String

eaplatanios commented 6 years ago

@lucaRadicalbit Does that refer to a graph saved with a previous version of the API or one both saved and restored with the current master?

lucataglia commented 6 years ago

@eaplatanios No, I saved the graph with the Python API and then restored the graph the 0.2.0-SNAPSHOTversion. Il the first time I have this problem, with the other version was everything ok.

eaplatanios commented 6 years ago

@lucaRadicalbit Ok. Let me look into this. It's just a matter of changing the default name of the read op.

eaplatanios commented 6 years ago

@lucaRadicalbit Could you please confirm that this has now been fixed? Thanks!

lucataglia commented 6 years ago

@eaplatanios At the moment I don't know why but in my project I still have your code without the bug fix done in the commit a084e85. I also try to clean the cache and reload everything.