Commit 0e723eb6 authored by Ilija Radosavovic's avatar Ilija Radosavovic Committed by Facebook Github Bot

Make model hash computation and comparison py3 compatible

Reviewed By: ashwinb

Differential Revision: D10223289

fbshipit-source-id: 1e6fb55f77e01a2f653fd614d13d1d4a7ceeccea
parent 367fda97
......@@ -159,9 +159,9 @@ def download_url(
def _get_file_md5sum(file_name):
"""Compute the md5 hash of a file."""
hash_obj = hashlib.md5()
with open(file_name, 'r') as f:
with open(file_name, 'rb') as f:
hash_obj.update(f.read())
return hash_obj.hexdigest()
return hash_obj.hexdigest().encode('utf-8')
def _get_reference_md5sum(url):
......
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