I came across a very strange bug running a Jupyter Notebook (IPython: 7.4.0) where a variable was not assigned as normally. It took me quite bit of time to figure out the cause, searching in vain all over, variable scope, type conversion and TensorFlow intricacies ;(
In fact, using %%time cell magic was preventing assignment of the variable in the cell. Therefore the assigned variable was not defined in the cell below giving a characteristic error message: "NameError: 'xxx' is not defined."
It seems to be a known issue, hoping that can help someone else.