douglasrizzo / detection_util_scripts

TF and YOLO utility scripts
MIT License
50 stars 37 forks source link

filename = group.filename.encode('utf8') #8

Closed julio8a closed 4 years ago

julio8a commented 4 years ago

Getting this error when generating the tfrecords.

  File "generate_tfrecord.py", line 31
    filename = group.filename.encode('utf8')
                                           ^
IndentationError: unindent does not match any outer indentation level

generating the csv and pbtxt worked fine.

layshowl commented 4 years ago

我也是出现了这个问题,求大神指点

julio8a commented 4 years ago

@layshowl,

I ended up using a different generate_tf file from the repository this fork came from and it worked for me: https://github.com/datitran/raccoon_dataset/blob/master/generate_tfrecord.py

if you have multiple classes you're trying to detect, i.e. Apple, Banana, and Peach then you need to modify line 32 to look like this:

    if row_label == 'Apple':
        return 1
    elif: row_label == 'Banana':
        return 2
    elif: row_label == 'Peach':
        return 3
    else:
        None
douglasrizzo commented 4 years ago

I fixed the indentation problem on master. It came from a PR.