|
|
@@ -12,14 +12,17 @@ from paddlex.utils.device import constr_device, parse_device
|
|
|
|
|
|
|
|
|
def worker(pipeline_name_or_config_path, device, task_queue, batch_size, output_dir):
|
|
|
+ import paddle
|
|
|
+ paddle.utils.run_check()
|
|
|
+
|
|
|
# 限制GPU内存使用,减少CUDA冲突
|
|
|
- os.environ["FLAGS_fraction_of_gpu_memory_to_use"] = "0.6"
|
|
|
+ # os.environ["FLAGS_fraction_of_gpu_memory_to_use"] = "0.6"
|
|
|
|
|
|
# 使用确定性算法
|
|
|
- os.environ["FLAGS_cudnn_deterministic"] = "1"
|
|
|
+ # os.environ["FLAGS_cudnn_deterministic"] = "1"
|
|
|
|
|
|
# 立即释放内存
|
|
|
- os.environ["FLAGS_eager_delete_tensor_gb"] = "0.0"
|
|
|
+ # os.environ["FLAGS_eager_delete_tensor_gb"] = "0.0"
|
|
|
|
|
|
pipeline = create_pipeline(pipeline_name_or_config_path, device=device)
|
|
|
|