question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Tensorflow code throws error in local server, but works in remote

See original GitHub issue

Environment data

  • VS Code version: Version: 1.53.2 Commit: 622cb03f7e070a9670c94bae1a45d78d7181fbd4 Date: 2021-02-11T11:45:54.515Z Electron: 11.2.1 Chrome: 87.0.4280.141 Node.js: 12.18.3 V8: 8.7.220.31-electron.0 OS: Darwin x64 19.6.0

  • Jupyter Extension version (available under the Extensions sidebar): Id: ms-toolsai.jupyter Version: 2021.2.576440691

  • Python Extension version (available under the Extensions sidebar): Id: ms-python.python Version: 2021.3.633143540-dev

  • OS (Windows | Mac | Linux distro) and version: MacOS 10.15.7 and Ubuntu 18.04.1

  • Python and/or Anaconda version: Python 3.8.6

  • Type of virtual environment used: pyenv virtualenv

  • Jupyter server running: Local

Expected behaviour

I expect code that runs on jupyter notebooks outside of vs code to run correctly inside vs code as well.

Actual behaviour

Some (possibly all?) Apache Beam PTransforms fail when running jupyter server locally.

Steps to reproduce:

[NOTE: Self-contained, minimal reproducing code samples are extremely helpful and will expedite addressing your issue]

  1. Create new virtualenv and install tensorflow 2.4 and tfx 0.27
pip install tensorflow==2.4.1 tfx==0.27.0
  1. Start jupyter server locally using that virtualenv (Jupyter: Create Interactive Window)

  2. Rename the attached file to .py and open in vs code

tft_example.py.txt

  1. Run file (Jupyter: Run Current File in Interactive Window)

Screen Shot 2021-03-08 at 10 52 59

Screen Shot 2021-03-08 at 11 00 07

Logs

jupyter.log

Additional Notes

I tried this with two different set ups: local development on macOS and using the remote extension server to run it in an Ubuntu remote host. In both cases the code will crash if vs code tries to manage the jupyter server and will run successfully if you manually start a server and connect vs code to it.

Screen Shot 2021-03-08 at 11 43 01

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
DavidKutucommented, Mar 9, 2021

Thanks for the issue @bguisard. I’m also able to follow your steps and get the same result. We’ll discuss it in our next triage meeting.

0reactions
DonJayamannecommented, Aug 21, 2022

Closing this issue as this is caused by a Python package thats beyond the control of this exension. I.e. the Jupyter extension doesn’t have any control over how the packages work, I believe the issue might have something to do with how the package is installed locally vs remote, or differences in the version of the package or differences in the Python environments.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Tensorflow script mode works locally but fails when running ...
Describe the bug Hi, I have a simple training script that works perfectly when training locally, but when I change to run from...
Read more >
PyCharm remote interpreter and Tensorflow -> can not import ...
In PyCharm I set up a remote debugger to my server machine, but now importing tensorflow results in an error: Traceback (most recent...
Read more >
FAQ - ClearML
My code throws an exception, but my experiment status is not "Failed". ... How do I bypass a proxy configuration to access my...
Read more >
Common issues | TensorFlow Hub
Often this is a problem specific to the machine running the code and not an issue with the library. Here is a list...
Read more >
Troubleshooting TensorFlow - TPU - Google Cloud
Trouble connecting to the TPU server · Run the following command to list the available TPUs. · Verify that you are passing the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found