Skip to content

Commit

Permalink
clear fluid (PaddlePaddle#10333)
Browse files Browse the repository at this point in the history
  • Loading branch information
tink2123 committed Jul 10, 2023
1 parent 722e9dc commit b0e3c3f
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 6 deletions.
3 changes: 1 addition & 2 deletions ppocr/optimizer/optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,7 @@ def __call__(self, model):
if self.group_lr:
if self.training_step == 'LF_2':
import paddle
if isinstance(model, paddle.fluid.dygraph.parallel.
DataParallel): # multi gpu
if isinstance(model, paddle.DataParallel): # multi gpu
mlm = model._layers.head.MLM_VRM.MLM.parameters()
pre_mlm_pp = model._layers.head.MLM_VRM.Prediction.pp_share.parameters(
)
Expand Down
1 change: 0 additions & 1 deletion test_tipc/supplementary/data_loader.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import numpy as np
from paddle.vision.datasets import Cifar100
from paddle.vision.transforms import Normalize
from paddle.fluid.dataloader.collate import default_collate_fn
import signal
import os
from paddle.io import Dataset, DataLoader, DistributedBatchSampler
Expand Down
2 changes: 1 addition & 1 deletion test_tipc/supplementary/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def amp_scaler(config):
'FLAGS_cudnn_batchnorm_spatial_persistent': 1,
'FLAGS_max_inplace_grad_add': 8,
}
paddle.fluid.set_flags(AMP_RELATED_FLAGS_SETTING)
paddle.set_flags(AMP_RELATED_FLAGS_SETTING)
scale_loss = config["AMP"].get("scale_loss", 1.0)
use_dynamic_loss_scaling = config["AMP"].get("use_dynamic_loss_scaling",
False)
Expand Down
2 changes: 1 addition & 1 deletion tools/eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def main():
'FLAGS_cudnn_batchnorm_spatial_persistent': 1,
'FLAGS_max_inplace_grad_add': 8,
}
paddle.fluid.set_flags(AMP_RELATED_FLAGS_SETTING)
paddle.set_flags(AMP_RELATED_FLAGS_SETTING)
scale_loss = config["Global"].get("scale_loss", 1.0)
use_dynamic_loss_scaling = config["Global"].get(
"use_dynamic_loss_scaling", False)
Expand Down
2 changes: 1 addition & 1 deletion tools/infer/utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ def get_infer_gpuid():
if sysstr == "Windows":
return 0

if not paddle.fluid.core.is_compiled_with_rocm():
if not paddle.device.is_compiled_with_rocm:
cmd = "env | grep CUDA_VISIBLE_DEVICES"
else:
cmd = "env | grep HIP_VISIBLE_DEVICES"
Expand Down

0 comments on commit b0e3c3f

Please sign in to comment.