• 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
.github Loading commit data...
cmake Loading commit data...
configs Loading commit data...
demo Loading commit data...
detectron Loading commit data...
docker Loading commit data...
projects/GN Loading commit data...
tools Loading commit data...
.gitignore Loading commit data...
CMakeLists.txt Loading commit data...
CONTRIBUTING.md Loading commit data...
FAQ.md Loading commit data...
GETTING_STARTED.md Loading commit data...
INSTALL.md Loading commit data...
LICENSE Loading commit data...
MODEL_ZOO.md Loading commit data...
Makefile Loading commit data...
NOTICE Loading commit data...
README.md Loading commit data...
requirements.txt Loading commit data...
setup.py Loading commit data...