hi i try to export tensorflow graph from python to c++ i receive the messege Failed precondition: Attempting to use uninitialized value Variable
python code with tf.Session() as sess: sess.run(tf.global_variables_initializer()) xin = tf.placeholder(tf.float32, (None,) + xdim) conv1W_a = tf.Variable(conv1Kernels.astype(np.float32)) conv1b_a = tf.Variable(conv1Bias.flatten().astype(np.float32)) conv1_in_a = conv(x, conv1W_a, conv1b_a, k_h, k_w, c_o, s_h, s_w, padding="VALID", group=1) #init = tf.initialize_variables(tf.all_variables(), name='init_all_vars_op') # sess.run(tf.global_variables_initializer()) tf.train.write_graph(sess.graph_def, './', 'mlp.pb', as_text=False) ============== *c++* status = tensorFlowSession->Run(inputs, { "Reshape_9" }, {}, &outputs); if (!status.ok()) { std::cout << status.ToString() << "\n"; } i get the name reshape_9 when i see the format of pb file as text full message Failed precondition: Attempting to use uninitialized value Variable_19 [[Node: Variable_19/read = Identity[T=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:CPU:0"](Variable_19)]] the filter is at size 96*11*11*3 the image is 227*227*3 all initialized -- You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+unsubscr...@googlegroups.com. To post to this group, send email to protobuf@googlegroups.com. Visit this group at https://groups.google.com/group/protobuf. For more options, visit https://groups.google.com/d/optout.