Commit dc8c4458 authored by dengjb's avatar dengjb
Browse files

Update utils.py

parent 0b1180d3
......@@ -45,7 +45,7 @@ class strLabelConverter(object):
for char in text
]
length = [len(text)]
elif isinstance(text, collections.Iterable):
else:
length = [len(s) for s in text]
text = ''.join(text)
text, _ = self.encode(text)
......@@ -170,4 +170,4 @@ class AverageMeter(object):
self.val = val
self.sum += val * n
self.count += n
self.avg = self.sum / self.count
\ No newline at end of file
self.avg = self.sum / self.count
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment