• Ashwin Bharambe's avatar
    Prepare for python3 compatibility [2] · 9185b699
    Ashwin Bharambe authored
    Summary:
    There were two "bugs" associated with loading pickle files:
    
    The first is easy: these files should have been `open()`ed as binary, but
    weren't.
    
    The second is slightly nuanced. The default encoding used wwhile unpickling
    is 7-bit (ASCII.) However, the blobs are arbitrary 8-bit bytes which don't
    agree. The absolute correct way to do this is to use `encoding="bytes"` and
    then interpret the blob names either as ASCII, or better, as unicode utf-8. A
    reasonable fix, however, is to treat it the encoding as 8-bit latin1 (which
    agrees with the first 256 characters of Unicode anyway.)
    
    As part of this, I also centralized all pickling operations into
    `detectron.utils.io`.
    
    This /still/ does not change the build to Python3, but I believe it is ready
    now.
    
    Reviewed By: rbgirshick
    
    Differential Revision: D9689294
    
    fbshipit-source-id: add1f2d784fe196df27b20e65e35922536d11a3c
    9185b699
Name
Last commit
Last update
..
convert_cityscapes_to_coco.py Loading commit data...
convert_coco_model_to_cityscapes.py Loading commit data...
convert_pkl_to_pb.py Loading commit data...
convert_selective_search.py Loading commit data...
generate_testdev_from_test.py Loading commit data...
infer.py Loading commit data...
infer_simple.py Loading commit data...
pickle_caffe_blobs.py Loading commit data...
reval.py Loading commit data...
test_net.py Loading commit data...
train_net.py Loading commit data...
visualize_results.py Loading commit data...