【问题标题】:Question: Model dowloading with custom vision & python API问题:使用自定义视觉和 python API 下载模型
【发布时间】:2020-07-20 16:07:30
【问题描述】:

我是 Microsoft 自定义视觉的新手,我正在使用 jupyter notebooks/python 集成 Microsoft Azure 自定义视觉 API。我能够上传图像,自动标记它们并训练第一次迭代。但是,当我尝试下载训练迭代/模型的 Docker 文件时,我在尝试导出模型时遇到了困难。使用函数 export_iteration 我最终得到了一个 mst.rest.pipeline.clientrawresponse 对象。我认为目前它只存储在导出队列中。如何访问此队列元素以将其下载到本地系统?

PS:我正在使用通用(紧凑)模型格式,因此它应该是可导出的。

示例代码:

# Initalize the Training Client 
training_key = "your-training-key"
ENDPOINT = "your-endpoint" 

c_plat = CustomVisionTrainingClient(training_key,ENDPOINT)
# List all projects you have
projects = c_plat.get_projects()

#Always take the newest project and its newest iteration and export it 
iterations = c_plat.get_iterations(projects[0].id)
c_plat.export_iteration(project_id=projects[0].id, iteration_id=iterations[0].id, platform = "DockerFile", raw=True, flavor = "ARM")

【问题讨论】:

    标签: python jupyter-notebook export microsoft-custom-vision


    【解决方案1】:

    经过反复试验,我找到了解决方案:

        #Always takes the newest project and its newest iteration
        iterations = c_plat.get_iterations(projects[0].id)
        response = c_plat.export_iteration(project_id=projects[0].id, iteration_id=iterations[0].id, platform = "DockerFile", raw=False, flavor="ARM")
    
        # Opnening the uri
        import webbrowser
        webbrowser.open(c_plat.get_exports(project_id=projects[0].id, iteration_id=iterations[0].id)[0].download_uri)
    

    这会在新标签页中打开 uri 并开始自动下载。希望这可能对其他人有所帮助。

    干杯!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-06-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-09-25
      • 1970-01-01
      相关资源
      最近更新 更多