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

Jupyter used to show my plots in VS Code now it doesn't #2284

Closed
brando90 opened this issue Feb 18, 2020 · 4 comments
Closed

Jupyter used to show my plots in VS Code now it doesn't #2284

brando90 opened this issue Feb 18, 2020 · 4 comments
Assignees

Comments

@brando90
Copy link

Environment data

Version: 1.42.1
Commit: c47d83b293181d9be64f27ff093689e8e7aed054
Date: 2020-02-11T14:44:27.652Z
Electron: 6.1.6
Chrome: 76.0.3809.146
Node.js: 12.4.0
V8: 7.6.303.31-electron.0
OS: Darwin x64 19.3.0

Expected behaviour

Show my torchviz plots on VS code

Actual behaviour

Says:

<graphviz.dot.Digraph at 0x124421490>

instead of displaying the image.

Steps to reproduce:

self contained code to reproduce:

import torch

from torchviz import make_dot

x = torch.randn(1)

y = 3*x

make_dot(y)

instead of displaying image it prints:

<graphviz.dot.Digraph at 0x128cc40d0>

Logs

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

EMPTY OUTPUT

Output from Console under the Developer Tools panel (toggle Developer Tools on under Help; turn on source maps to make any tracebacks be useful by running Enable source map support for extension debugging)


console.ts:137 [Extension Host] Info Python Extension: 2020-02-18 10:11:01: Activating Environment to capture Environment variables, . /Users/brandomiranda/miniconda3/envs/automl-meta-learning/bin/activate && conda activate base && echo 'e8b39361-0157-4923-80e1-22d70d46dee6' && python /Users/brandomiranda/.vscode/extensions/ms-python.python-2020.2.63072/pythonFiles/printEnvVariables.py
console.ts:137 [Extension Host] Info Python Extension: 2020-02-18 10:11:01: parseEnvironmentOutput, Class name = S, completed in 0ms
console.ts:137 [Extension Host] Info Python Extension: 2020-02-18 10:11:01: getActivatedEnvironmentVariables, Class name = S, completed in 1579ms, Arg 1: undefined, Arg 2: {"architecture":3,"path":"/Users/brandomiranda/miniconda3/envs/automl-meta-learning/bin/python","version":{"options":{"loose":false,"includePrerelease":false},"loose":false,"raw":"3.7.6-final","major":3,"minor":7,"patch":6,"prerelease":["final"],"build":[],"version":"3.7.6-final"},"sysPrefix":"/Users/brandomiranda/miniconda3/envs/automl-meta-learning","fileHash":"d6fcec69eb45106b78c8b7e2bdc1a01e7ec3e18c1891b180796455cb288051a6c198219bb18a867ffb6d9a6488901a5ad21f316f65277c27de3c4ccef07d7d00","companyDisplayName":"Anaconda, Inc.","type":"Conda","envPath":"/Users/brandomiranda/miniconda3/envs/automl-meta-learning","envName":"base","displayName":"Python 3.7.6 64-bit"}, Arg 3: true
console.ts:137 [Extension Host] Info Python Extension: 2020-02-18 10:11:29: Submitting code for 7627e4a1-eb0d-41d8-aab7-8f9e617fa3c3
console.ts:137 [Extension Host] Info Python Extension: 2020-02-18 10:11:29: Waiting for jupyter server and web panel ...
console.ts:137 [Extension Host] Info Python Extension: 2020-02-18 10:11:29: Cached data exists getEnvironmentVariables, <No Resource>
console.ts:137 [Extension Host] Info Python Extension: 2020-02-18 10:11:29: Getting jupyter server options ...
console.ts:137 [Extension Host] Info Python Extension: 2020-02-18 10:11:29: Connecting to jupyter server ...
console.ts:137 [Extension Host] Info Python Extension: 2020-02-18 10:11:29: Connected to jupyter server.
console.ts:137 [Extension Host] Info Python Extension: 2020-02-18 10:11:29: Finished execution for 0651c08b-fab6-4f76-a9cf-aaae3959bedf
console.ts:137 [Extension Host] Info Python Extension: 2020-02-18 10:12:21: Cached data exists getEnvironmentVariables, tasks
log.ts:197   ERR No application in the Launch Services database matches the input criteria.: Error: No application in the Launch Services database matches the input criteria.
@brando90
Copy link
Author

I'm unsure if I have the most recent version of everything cuz I am using this debugger: microsoft/ptvsd#1706

although things were working perfectly well last night so I am unsure what happened overnight...

@brando90
Copy link
Author

related bug, but VS code doesn't save my images either:

(automl-meta-learning) brandomiranda~/automl-meta-learning/prototyping_tests_playground/trainable_optimizers ❯ env PTVSD_LAUNCHER_PORT=55117 /Users/brandomiranda/miniconda3/envs/automl-meta-learning/bin/python /Users/brandomiranda/.vscode/extensions/ms-python.python-2020.2.63072/pythonFiles/lib/python/new_ptvsd/wheels/ptvsd/launcher /Users/brandomiranda/automl-meta-learning/prototyping_tests_playground/trainable_optimizers/torch_viz_graph.py 

with script:

import torch

from torchviz import make_dot

x = torch.randn(1)

y = 3*x

make_dot(y).render('image', format='png')

but running the file directly from the integrated terminal seems to work:

automl-meta-learning) brandomiranda~/automl-meta-learning/prototyping_tests_playground/trainable_optimizers ❯ python torch_viz_graph.py 
(automl-meta-learning) brandomiranda~/automl-meta-learning/prototyping_tests_playground/trainable_optimizers ❯ ls
__pycache__                             cifar10_tutorial.ipynb                  detached_deepcopy.ipynb                 differentiable_mdl.py                   image                                   sample_torchviz.ipynb                   torch_viz_same_graph.ipynb
backprop_through_optimizer.py           clone_playground.ipynb                  diff_over_backward.py                   extracting_gradients_as_data.ipynb      image.png                               scheduler.ipynb                         visualize_complicated_detach.ipynb
backward_twice.ipynb                    data                                    differentiable_mdl.ipynb                grad_test_sympy.py                      is_leaf.ipynb                           torch_viz_graph.py                      visualize_pytorch_graphs.ipynb

@IanMatthewHuff IanMatthewHuff self-assigned this Feb 18, 2020
@IanMatthewHuff
Copy link
Member

@brando90 thanks for the report on this. I see the issue. I think that we regressed something in our last release. I'll look at getting a fix out quick.

@rchiodo
Copy link
Contributor

rchiodo commented Feb 20, 2020

Validated

@rchiodo rchiodo closed this as completed Feb 20, 2020
@lock lock bot locked as resolved and limited conversation to collaborators Feb 28, 2020
@microsoft microsoft unlocked this conversation Nov 13, 2020
@DonJayamanne DonJayamanne transferred this issue from microsoft/vscode-python Nov 13, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants