Skip to content

Attempting to use uninitialized value x #140

Closed
@Oceania2018

Description

@Oceania2018
        [TestMethod]
        public void Add()
        {
            var x = tf.Variable(10, name: "x");

            var model = tf.global_variables_initializer();

            using (var session = tf.Session())
            {
                var sm = session.run(model);
                for(int i = 0; i < 5; i++)
                {
                    var x1 = x + 1;
                    var result = session.run(x1);
                    print(result);
                }
            }
        }

The unit test above throws exception:
Attempting to use uninitialized value x [[{{node x/read}}]]

Metadata

Metadata

Labels

bugSomething isn't workinghelp wantedExtra attention is needed

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions