Skip start epoch and end epoch when dumping strategy in PaddleSlim (#19580)

test=develop
fix_crf_doc
whs 6 years ago committed by GitHub
parent c5548178b0
commit 1c2aae567a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -27,7 +27,7 @@ __all__ = ['ConfigFactory']
"""This factory is used to create instances by loading and parsing configure file with yaml format. """This factory is used to create instances by loading and parsing configure file with yaml format.
""" """
PLUGINS = ['pruners', 'quantizers', 'quantizers', 'strategies', 'controllers'] PLUGINS = ['pruners', 'quantizers', 'distillers', 'strategies', 'controllers']
class ConfigFactory(object): class ConfigFactory(object):

@ -29,6 +29,13 @@ class Strategy(object):
self.start_epoch = start_epoch self.start_epoch = start_epoch
self.end_epoch = end_epoch self.end_epoch = end_epoch
def __getstate__(self):
d = {}
for key in self.__dict__:
if key not in ["start_epoch", "end_epoch"]:
d[key] = self.__dict__[key]
return d
def on_compression_begin(self, context): def on_compression_begin(self, context):
pass pass

Loading…
Cancel
Save