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

Enable JSON-based graph construction #22

Closed
nikhilk opened this issue Jan 6, 2018 · 2 comments
Closed

Enable JSON-based graph construction #22

nikhilk opened this issue Jan 6, 2018 · 2 comments
Labels

Comments

@nikhilk
Copy link
Owner

nikhilk commented Jan 6, 2018

We should be able to construct a graph in node.js using protocol-buffers directly. For example:

var node1 = {
  name: 'Const',
  op: 'Const',
  attr: {
    dtype: {
      type: 3
    },
    value: {
      tensor: {
        dtype: 3,
        tensorShape: {},
        int_val: [1]
      }
    }
  }
}

var graph = {
  node: [
    node1
  ]
}

let graph = tf.Graph.fromGraphDefObject(graph)

Which uses the encode method of the compiled protobuf message.

While the encode and subsequent construction of a Graph and Session works fine, session.run results in a segmentation fault, suggesting an invalid attribute or some other detail of the graph.

@nikhilk
Copy link
Owner Author

nikhilk commented Jan 16, 2018

Addressed in ecd28d7

@nikhilk
Copy link
Owner Author

nikhilk commented Jan 21, 2018

Functionality included in 0.7.0.

@nikhilk nikhilk closed this as completed Jan 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant