add feature calc log (#865)

pull/873/head
littletomatodonkey 2021-06-16 21:12:47 +08:00 committed by GitHub
parent a10dd0ac8a
commit 60c2106f13
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -476,6 +476,10 @@ class Trainer(object):
has_unique_id = False
for idx, batch in enumerate(dataloader(
)): # load is very time-consuming
if idx % self.config["Global"]["print_batch_step"] == 0:
logger.info(
f"{name} feature calculation process: [{idx}/{len(dataloader)}]"
)
batch = [paddle.to_tensor(x) for x in batch]
batch[1] = batch[1].reshape([-1, 1]).astype("int64")
if len(batch) == 3: