1

I am using skflow for simple classification. What I noticed is that I have multiple sessions/graphs. For example, error that I get is

ValueError: Cannot execute operation using Run(): No default session is registered. Use 'with default_session(sess)' or pass an explicit session to Run(session=sess)

When I try to set in the main function a tf.Session().as_default(), I realized that there is another session and graph created by skflow. After research that came to be true. Indeed, skflow creates it here.

classifier = skflow.TensorFlowEstimator(
                model_fn=model_fn, n_classes=2,
                steps=100, optimizer='Adam',
                learning_rate=0.01, continue_training=True)

My problem is that I want to print some variables that are used during training. For example, word embeddings matrix. In my model_fn, I save the word embeddings matrix since I have access to it. But when I try printing it, it seems that sessions was closed and i get that error I mentioned above. So I am not sure how I can set one default sessions, why skflow created another one, how can I print a varibale that is used inside of skflow classifier, and also why in SummaryWriter Graph tensorboard I only see the main graph (not the one in skflow)?

I might be very wrong so Any help would be appreciated!

Maika
  • 11
  • 2

0 Answers0