diff --git a/lightflow/models/dag.py b/lightflow/models/dag.py
index <HASH>..<HASH> 100644
--- a/lightflow/models/dag.py
+++ b/lightflow/models/dag.py
@@ -133,7 +133,7 @@ class Dag:
         for task in nx.topological_sort(graph):
             task.workflow_name = self.workflow_name
             task.dag_name = self.name
-            if len(graph.predecessors(task)) == 0:
+            if len(list(graph.predecessors(task))) == 0:
                 task.state = TaskState.Waiting
                 tasks.append(task)
 
@@ -166,7 +166,7 @@ class Dag:
                     if stopped:
                         task.state = TaskState.Stopped
                     else:
-                        pre_tasks = graph.predecessors(task)
+                        pre_tasks = list(graph.predecessors(task))
                         if all([p.is_completed for p in pre_tasks]):
 
                             # check whether the task should be skipped
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -43,7 +43,7 @@ setup(
         'celery>=4.0.2',
         'click>=6.7',
         'colorlog>=2.10.0',
-        'networkx>=1.11,<2',
+        'networkx',
         'pymongo>=3.6.0',
         'pytz>=2016.10',
         'redis>=2.10.5',
updated for networkx <I> (#<I>)