You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
>>> %tb
RuntimeError: dictionary changed size during iteration
....
<ipython-input-1-12c676190a3c> in __rodeo_get_variables(session)
29
30 SPECIAL_VARS = ["In", "Out"]
---> 31 for variable_name in session.keys():
32
33 if variable_name.startswith("_") or variable_name in SPECIAL_VARS:
RuntimeError: dictionary changed size during iteration
In Python 2.x calling keys makes a copy of the key that you can iterate over while modifying the dict:
for variable_name in session.keys():
This doesn't work in Python 3.x because keys returns an iterator instead of a list. Apparently the work-around for Python 3.x is to use list() to force a copy of the keys to be made:
for variable_name in list(session):
The text was updated successfully, but these errors were encountered:
rodeo/src/node/kernels/python/patch.py
Line 31 in aa1929b
In Python 2.x calling keys makes a copy of the key that you can iterate over while modifying the dict:
This doesn't work in Python 3.x because keys returns an iterator instead of a list. Apparently the work-around for Python 3.x is to use list() to force a copy of the keys to be made:
The text was updated successfully, but these errors were encountered: