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

Go: Unable to create two ops of the same type using generated op wrapper functions #6799

Closed
asimshankar opened this issue Jan 12, 2017 · 2 comments
Assignees
Labels

Comments

@asimshankar
Copy link
Contributor

As reported in #10 (comment) , the following test (at head: d4b5c60):

package bug

import (
        "testing"

        tf "github.com/tensorflow/tensorflow/tensorflow/go"
        "github.com/tensorflow/tensorflow/tensorflow/go/op"
)

func TestBug(t *testing.T) {
        scope := op.NewScope()
        op.Placeholder(scope.Subscope("x"), tf.Float)
        op.Placeholder(scope.Subscope("y"), tf.Float)
        if _, err := scope.Finalize(); err != nil {
                t.Fatal(err)
        }
}

fails with:

--- FAIL: TestBug (0.01s)
	bug_test.go:15: failed to add operation "Placeholder": Duplicate node name in graph: 'Placeholder' (Stacktrace: goroutine 19 [running]:
		runtime/debug.Stack(0x0, 0x0, 0x0)
			/usr/local/go/src/runtime/debug/stack.go:24 +0x79
		github.com/tensorflow/tensorflow/tensorflow/go/op.(*Scope).UpdateErr(0xc420072420, 0x411b8ac, 0xb, 0x4196640, 0xc42007c030)
			/home/go/src/github.com/tensorflow/tensorflow/tensorflow/go/op/scope.go:106 +0x72
		github.com/tensorflow/tensorflow/tensorflow/go/op.(*Scope).AddOperation(0xc420072420, 0x411b8ac, 0xb, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc420072450, 0x4108b00)
			/home/go/src/github.com/tensorflow/tensorflow/tensorflow/go/op/scope.go:70 +0xbf
		github.com/tensorflow/tensorflow/tensorflow/go/op.Placeholder(0xc420072420, 0x1, 0x0, 0x0, 0x0, 0xc42006e4f0, 0x0)
			/home/go/src/github.com/tensorflow/tensorflow/tensorflow/go/op/wrappers.go:4734 +0x1c7
		github.com/tensorflow/tensorflow/tensorflow/go/b10.TestBug(0xc420098180)
			/home/go/src/github.com/tensorflow/tensorflow/tensorflow/go/b10/bug_test.go:13 +0xd2
		testing.tRunner(0xc420098180, 0x4129d88)
			/usr/local/go/src/testing/testing.go:610 +0x81
		created by testing.(*T).Run
			/usr/local/go/src/testing/testing.go:646 +0x2ec
		)

(Thanks for pointing this out @sdeoras).

@asimshankar asimshankar self-assigned this Jan 12, 2017
@asimshankar asimshankar mentioned this issue Jan 12, 2017
@drpngx drpngx closed this as completed in 2abef5c Jan 13, 2017
@sdeoras
Copy link
Contributor

sdeoras commented Jan 13, 2017

Thanks folks for quick resolution. It is working great now!

@drpngx
Copy link
Contributor

drpngx commented Jan 13, 2017

Woohoo!

@aselle aselle added type:bug Bug and removed bug labels Feb 9, 2017
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

4 participants