Difficult to say exactly what's going wrong without more of your code available, but I had the same error this morning. 'NoneType' object has no attribute 'graph' - you're trying to access "graph" on a NoneType object, i.e. before you get this error,...