def test_download_repo_of_dir(): md_path = '../mshub_res/assets/mindspore/gpu/1.0/googlenet_v1_cifar10.md' cell = CellInfo("googlenet") cell.update(md_path) git_url = cell.repo_link set_hub_dir('.cache') path = get_hub_dir() ret = _download_repo_from_url(git_url, path) assert ret
def test_load_weights_input_uid(): """test load_weights.""" set_hub_dir('.cache') path = get_hub_dir() repo_link = 'https://gitee.com/mindspore/models/tree/master/official/cv/googlenet' _download_repo_from_url(repo_link, path) net = _get_network_from_cache('GoogleNet', path + '/googlenet', 10) load_weights(net, handle='mindspore/ascend/1.0/googlenet_v1_cifar10', force_reload=True) print(net)
def test_download_ckpt(): """test download ckpt.""" md_path = '../mshub_res/assets/mindspore/gpu/1.0/googlenet_v1_cifar10.md' cell = CellInfo("googlenet") cell.update(md_path) asset_link = cell.asset[cell.asset_id]['asset-link'] asset_sha256 = cell.asset[cell.asset_id]["asset-sha256"] set_hub_dir('.cache') path = get_hub_dir() ckpt_path = _download_file_from_url(asset_link, hash_sha256=asset_sha256, save_path=path) assert os.path.exists(ckpt_path)
def test_download_repo(): git_url = 'https://gitee.com/mindspore/models/tree/master/official/cv/googlenet' set_hub_dir('.cache') path = get_hub_dir() ret = _download_repo_from_url(git_url, path) assert ret