aaronmarkham commented on a change in pull request #12621: Add docstring in
im2rec.py
URL: https://github.com/apache/incubator-mxnet/pull/12621#discussion_r219583744
##########
File path: tools/im2rec.py
##########
@@ -95,24 +121,41 @@ def make_list(args):
write_list(args.prefix + str_chunk + '_train.lst',
chunk[sep_test:sep_test + sep])
def read_list(path_in):
+ """Reads the .lst file and generates corresponding iterator.
+ Parameters
+ ----------
+ path_in: string
+ Returns
+ -------
+ item iterator that contains information in .lst file
+ """
with open(path_in) as fin:
while True:
line = fin.readline()
if not line:
break
line = [i.strip() for i in line.strip().split('\t')]
line_len = len(line)
+ # check the data format of .lst file
if line_len < 3:
- print('lst should at least has three parts, but only has %s
parts for %s' %(line_len, line))
+ print('lst should at least has three parts, but only has %s
parts for %s' % (line_len, line))
Review comment:
lst should have at least three parts
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services