Browse Source

check word_size before init_parallel to avoid warning

will-jl944 4 năm trước cách đây
mục cha
commit
2225249f85
1 tập tin đã thay đổi với 2 bổ sung1 xóa
  1. 2 1
      paddlex/utils/env.py

+ 2 - 1
paddlex/utils/env.py

@@ -68,4 +68,5 @@ def init_parallel_env():
         random.seed(local_seed)
         np.random.seed(local_seed)
 
-    paddle.distributed.init_parallel_env()
+    if paddle.distributed.get_world_size() > 1:
+        paddle.distributed.init_parallel_env()