(file_path, gzip=False)
return obj
Unpickle obj from file_path with gzipping.
Unpickle obj from file_path with gzipping.
Unpickle obj from file_path with gzipping .
def unpickle_from_file(file_path, gzip=False):
  """Unpickle obj from file_path with gzipping."""
  with tf.io.gfile.GFile(file_path, 'rb') as f:
    if not gzip:
      obj = pickle.load(f)
    else:
      with gzip_lib.GzipFile(fileobj=f, compresslevel=2) as gzipf:
        obj = pickle.load(gzipf)
  return obj
def unpickle_from_file ( file_path , gzip = False ) : with tf . io . gfile . GFile ( file_path , 'rb' ) as f : if not gzip : obj = pickle . load ( f ) else : with gzip_lib . GzipFile ( fileobj = f , compresslevel = 2 ) as gzipf : obj = pickle . load ( gzipf ) return obj