Closed DemonsHunter closed 3 years ago
Hi! Wow, that is strange. Oh, are you using python2? that might be the issue.
On Python 3, I actually get a different error:
>>> with tsensor.explain():
... a = np.ones(3)
...
Traceback (most recent call last):
File "<stdin>", line 2, in <module>
File "<stdin>", line 2, in <module>
File "/Users/parrt/github/tensor-sensor/tsensor/analysis.py", line 274, in listener
self.line_listener(module, name, filename, line, info, frame)
File "/Users/parrt/github/tensor-sensor/tsensor/analysis.py", line 282, in line_listener
code = info.code_context[0].strip()
TypeError: 'NoneType' object is not subscriptable
Sorry for applying too late, actually I use Python3. And I also wonder why the same code leads to different error. I guess that it partly due to the tsenor does not include the function "np.ones". I am not sure and I will keep an eye on related error or issues.
Ok, think I figured this out. You're using ipython and I'm using python. Also, it appears to be different if I run it in interactive mode!!! investigating
Hi! I really thank u for your brilliant work of tsensor which help me to debug more effectively.
But recently, when I run this code in Jupyter or Pycharm, it always leads to a KeyError:
code: with ts.explain(): a = np.ones(3)
KeyError report: KeyError Traceback (most recent call last)