utils.py 文件源码

python
阅读 17 收藏 0 点赞 0 评论 0

项目:tensorflow_lstm_ctc_ocr 作者: linfan 项目源码 文件源码
def maybe_download(filename, expected_bytes, force=False):
    """Download a file if not present, and make sure it's the right size."""
    if force or not os.path.exists(filename):
        print('Attempting to download:', filename)
        filename, _ = urlretrieve(url + filename, filename,
                                  reporthook=download_progress_hook)
        print('\nDownload Complete!')
    statinfo = os.stat(filename)

    if statinfo.st_size == expected_bytes:
        print('Found and verified', filename)
    else:
        raise Exception(
            'Failed to verify ' + filename + \
            '. Can you get to it with a browser?')
    return filename
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号