make sure state exists
@@ -215,6 +215,7 @@ class TrainClosure(Closure):
def _fire_event(self, engine, output, event):
if engine is not None:
+ if engine.state is not None:
engine.state.model_output = output
engine.fire_event(event)
