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

How to run in python3 #8

Closed
green-john opened this issue Mar 3, 2016 · 0 comments
Closed

How to run in python3 #8

green-john opened this issue Mar 3, 2016 · 0 comments

Comments

@green-john
Copy link

First of all, Thank you for this. It is awesome.

Second, I have started porting the code to python3 (all my env is python3) and I have got the extension and the plots to show on Jupyter. However I am now running into problems when setting breakpoints. What happens is, once the bp is hit, the code keeps executing. I have looked at the code, and I don't know if I am using the bp capability wrong, or if there is issues with python3.

Here is where I use tdb

for _ in range(n_batches):
    batch = data_gen.get_batch(batch_size)
    feed = {X: batch[0], y: one_hot(batch[1], n_classes)}
    stat, res = tdb.debug([train_step, cross_entropy, accuracy, y_],
                                      feed_dict=feed, break_immediately=True,
                                      session=sess)

And this is the output when I run that:

Breakpoint triggered. Next Node:  SoftmaxCrossEntropyWithLogits_1:0
Breakpoint triggered. Next Node:  SoftmaxCrossEntropyWithLogits_1:0
Breakpoint triggered. Next Node:  SoftmaxCrossEntropyWithLogits_1:0
Breakpoint triggered. Next Node:  SoftmaxCrossEntropyWithLogits_1:0
Breakpoint triggered. Next Node:  SoftmaxCrossEntropyWithLogits_1:0
Breakpoint triggered. Next Node:  SoftmaxCrossEntropyWithLogits_1:0
Breakpoint triggered. Next Node:  SoftmaxCrossEntropyWithLogits_1:0
Breakpoint triggered. Next Node:  SoftmaxCrossEntropyWithLogits_1:0

It doesn't stop until after the code has executed. My changes to make the code python3 compatible include very simple things:

  • Make all the imports relative, i.e. change import asdf for from . import asdf
  • Change StringIO for io.BytesIO.
  • Change base64.b64encode for base64.encodebytes.

I have the suspicion that this is the intended behavior and that I should check the value of status and stop execution based on it, however I want to make sure this is the case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants