lf1-io / padl

Functional deep learning
Apache License 2.0
106 stars 4 forks source link

Scary PYDEV DEBUGGER WARNING when creating a padl.transform in a function on colab #452

Closed philip-bl closed 2 years ago

philip-bl commented 2 years ago

🐞 Bug

This minimal example on Google Colab causes a PYDEV DEBUGGER WARNING when I define a padl pipeline. I don't know what this warning means and if it means that I've got a problem. Please prevent it or document it somewhere.

The code is

import padl
def make_padl_assert(predicate):
  @padl.transform
  def asserting_identity(arg):
    assert predicate(arg)
    return arg
  return asserting_identity
pipeline = padl.Identity() >> make_padl_assert(lambda s: len(s) >= 10) >> padl.same[4:10]

The warning's text is

PYDEV DEBUGGER WARNING:
sys.settrace() should not be used when the debugger is being used.
This may cause the debugger to stop working correctly.
If this is needed, please check: 
http://pydev.blogspot.com/2007/06/why-cant-pydev-debugger-work-with.html
to see how to restore the debug tracing back correctly.
Call Location:
  File "/usr/local/lib/python3.7/dist-packages/padl/dumptools/inspector.py", line 140, in trace_this
    sys.settrace(lambda _a, _b, _c: None)

PYDEV DEBUGGER WARNING:
sys.settrace() should not be used when the debugger is being used.
This may cause the debugger to stop working correctly.
If this is needed, please check: 
http://pydev.blogspot.com/2007/06/why-cant-pydev-debugger-work-with.html
to see how to restore the debug tracing back correctly.
Call Location:
  File "/usr/local/lib/python3.7/dist-packages/padl/dumptools/inspector.py", line 134, in trace
    sys.settrace(previous_tracefunc)

Expected behavior

Everything works and there is no warning.

wuhu commented 2 years ago

Thanks for reporting this. I'm investigating what could be the reason for this warning. It seems that at best, this has no consequences, at worst there is some interference (e.g. breakpoints stop working) with the pydev debugger (and potentially others as well). I'll give an update once I find out more.

wuhu commented 2 years ago

See PR description.