@@ -183,10 +183,10 @@ def calib_dataloader(self, dataloader):
183
183
Args:
184
184
dataloader(generator): user are supported to set a user defined dataloader
185
185
which meet the requirements that can yield tuple of
186
- (input, label)/(input, _) batched data.
187
- Another good practice is to use lpot.experimental.common.DataLoader
188
- to initialize a lpot dataloader object.
189
- Notice lpot.experimental.common.DataLoader is just a wrapper of the
186
+ (input, label)/(input, _) batched data. Another good
187
+ practice is to use lpot.experimental.common.DataLoader
188
+ to initialize a lpot dataloader object. Notice
189
+ lpot.experimental.common.DataLoader is just a wrapper of the
190
190
information needed to build a dataloader, it can't yield
191
191
batched data and only in this setter method
192
192
a 'real' calib_dataloader will be created,
@@ -215,16 +215,19 @@ def eval_dataloader(self, dataloader):
215
215
dataloader(generator): user are supported to set a user defined dataloader
216
216
which meet the requirements that can yield tuple of
217
217
(input, label)/(input, _) batched data.
218
- Another good practice is to use lpot.experimental.common.DataLoader
218
+ Another good practice is to use
219
+ lpot.experimental.common.DataLoader
219
220
to initialize a lpot dataloader object.
220
- Notice lpot.experimental.common.DataLoader is just a wrapper of the
221
- information needed to build a dataloader, it can't yield
221
+ Notice lpot.experimental.common.DataLoader
222
+ is just a wrapper of the information needed to
223
+ build a dataloader, it can't yield
222
224
batched data and only in this setter method
223
225
a 'real' eval_dataloader will be created,
224
226
the reason is we have to know the framework info
225
227
and only after the Quantization object created then
226
- framework infomation can be known. Future we will support
227
- creating iterable dataloader from lpot.experimental.common.DataLoader
228
+ framework infomation can be known.
229
+ Future we will support creating iterable dataloader
230
+ from lpot.experimental.common.DataLoader
228
231
229
232
"""
230
233
from .common import _generate_common_dataloader
@@ -241,12 +244,15 @@ def model(self, user_model):
241
244
242
245
Args:
243
246
user_model: user are supported to set model from original framework model format
244
- (eg, tensorflow frozen_pb or path to a saved model), but not recommended.
245
- Best practice is to set from a initialized lpot.experimental.common.Model.
246
- If tensorflow model is used, model's inputs/outputs will be auto inferenced,
247
- but sometimes auto inferenced inputs/outputs will not meet your requests,
248
- set them manually in config yaml file. Another corner case is slim model
249
- of tensorflow, be careful of the name of model configured in yaml file,
247
+ (eg, tensorflow frozen_pb or path to a saved model),
248
+ but not recommended. Best practice is to set from a initialized
249
+ lpot.experimental.common.Model.
250
+ If tensorflow model is used, model's inputs/outputs will be
251
+ auto inferenced, but sometimes auto inferenced
252
+ inputs/outputs will not meet your requests,
253
+ set them manually in config yaml file.
254
+ Another corner case is slim model of tensorflow,
255
+ be careful of the name of model configured in yaml file,
250
256
make sure the name is in supported slim model list.
251
257
252
258
"""
@@ -284,10 +290,11 @@ def metric(self, user_metric):
284
290
and user_metric.metric_cls should be sub_class of lpot.metric.BaseMetric.
285
291
286
292
Args:
287
- user_metric(lpot.experimental.common.Metric): user_metric should be object initialized from
288
- lpot.experimental.common.Metric, in this method the
289
- user_metric.metric_cls will be registered to
290
- specific frameworks and initialized.
293
+ user_metric(lpot.experimental.common.Metric):
294
+ user_metric should be object initialized from
295
+ lpot.experimental.common.Metric, in this method the
296
+ user_metric.metric_cls will be registered to
297
+ specific frameworks and initialized.
291
298
292
299
"""
293
300
from .common import Metric as LpotMetric
@@ -317,7 +324,8 @@ def postprocess(self, user_postprocess):
317
324
318
325
Args:
319
326
user_postprocess(lpot.experimental.common.Postprocess):
320
- user_postprocess should be object initialized from lpot.experimental.common.Postprocess,
327
+ user_postprocess should be object initialized from
328
+ lpot.experimental.common.Postprocess,
321
329
in this method the user_postprocess.postprocess_cls will be
322
330
registered to specific frameworks and initialized.
323
331
@@ -328,7 +336,8 @@ def postprocess(self, user_postprocess):
328
336
postprocess_cfg = {user_postprocess .name : {** user_postprocess .kwargs }}
329
337
if deep_get (self .conf .usr_cfg , "evaluation.accuracy.postprocess" ):
330
338
logger .warning ('already set postprocess in yaml file, will override it...' )
331
- deep_set (self .conf .usr_cfg , "evaluation.accuracy.postprocess.transform" , postprocess_cfg )
339
+ deep_set (
340
+ self .conf .usr_cfg , "evaluation.accuracy.postprocess.transform" , postprocess_cfg )
332
341
from ..data import TRANSFORMS
333
342
postprocesses = TRANSFORMS (self .framework , 'postprocess' )
334
343
postprocesses .register (user_postprocess .name , user_postprocess .postprocess_cls )
0 commit comments