remove fluid
parent
bd2869dead
commit
c22bdc7e54
|
@ -221,7 +221,7 @@ class Engine(object):
|
|||
AMP_RELATED_FLAGS_SETTING.update({
|
||||
'FLAGS_cudnn_batchnorm_spatial_persistent': 1
|
||||
})
|
||||
paddle.fluid.set_flags(AMP_RELATED_FLAGS_SETTING)
|
||||
paddle.set_flags(AMP_RELATED_FLAGS_SETTING)
|
||||
|
||||
self.scale_loss = self.config["AMP"].get("scale_loss", 1.0)
|
||||
self.use_dynamic_loss_scaling = self.config["AMP"].get(
|
||||
|
|
|
@ -62,8 +62,8 @@ def load_params(exe, prog, path, ignore_params=None):
|
|||
"""
|
||||
Load model from the given path.
|
||||
Args:
|
||||
exe (fluid.Executor): The fluid.Executor object.
|
||||
prog (fluid.Program): load weight to which Program object.
|
||||
exe (paddle.static.Executor): The paddle.static.Executor object.
|
||||
prog (paddle.static.Program): load weight to which Program object.
|
||||
path (string): URL string or loca model path.
|
||||
ignore_params (list): ignore variable to load when finetuning.
|
||||
It can be specified by finetune_exclude_pretrained_params
|
||||
|
|
|
@ -87,7 +87,7 @@ def main(args):
|
|||
'FLAGS_max_inplace_grad_add': 8,
|
||||
}
|
||||
os.environ['FLAGS_cudnn_batchnorm_spatial_persistent'] = '1'
|
||||
paddle.fluid.set_flags(AMP_RELATED_FLAGS_SETTING)
|
||||
paddle.set_flags(AMP_RELATED_FLAGS_SETTING)
|
||||
|
||||
use_xpu = global_config.get("use_xpu", False)
|
||||
use_npu = global_config.get("use_npu", False)
|
||||
|
|
|
@ -112,7 +112,7 @@ def get_path_from_url(url,
|
|||
str: a local path to save downloaded models & weights & datasets.
|
||||
"""
|
||||
|
||||
from paddle.fluid.dygraph.parallel import ParallelEnv
|
||||
from paddle.distributed import ParallelEnv
|
||||
|
||||
assert is_url(url), "downloading from {} not a url".format(url)
|
||||
# parse path after download to decompress under root_dir
|
||||
|
|
Loading…
Reference in New Issue