python-3.x - 如何将数据从 Azure ML(笔记本)传输到存储容器
问题描述
我需要将文件从我的 Azure ML 工作区(笔记本文件夹)传输到存储容器。在 jupyter notebook 中试过这个;
import azureml.core
from azureml.core import Workspace, Datastore
import json
subscription_id = 'key1'
resource_group = 'rg_grp'
workspace_name = 'dev'
workspace = Workspace(subscription_id, resource_group, workspace_name)
# get the datastore to upload prepared data
datastore = Datastore.get(workspace, datastore_name='input') # using an existing mapped datastore in azure ML
# upload the local file from src_dir to the target_path in datastore
datastore.upload_files(['./folder1/output.csv'], relative_root='folder1', target_path='folder1', overwrite=True, show_progress=True)
一旦我运行要上传的代码块,我就会收到此错误消息,
UserErrorException: UserErrorException:
Message: './folder1/output.csv' does not point to a file. Please upload the file to cloud-first if running in a cloud notebook.
InnerException None
ErrorResponse
{
"error": {
"code": "UserError",
"message": "'./folder1/output.csv' does not point to a file. Please upload the file to cloud first if running in a cloud notebook."
}
}
CSV 文件已经在我的笔记本中。
任何帮助,将不胜感激
问候
解决方案
我最近遇到了一个类似的问题。
您需要引用文件存储位置的绝对路径,但在我看来,在开始时使用点表示法,您使用的是不能与此方法一起使用的相对路径。
所以你在文件列表中的值应该来自:
'./folder1/output.csv'
至
'/root/子文件夹/folder1/output.csv'
显然要确保您的根和子文件夹命名正确!
推荐阅读
- python - 在 Python 中将日期时间索引与稍微不同的日期合并
- r - 使用线性插值法在一个变量中插值 NA 值
- vue.js - 跟踪、记录 500 个错误 VUE NUXT
- android-studio - ESP8266 模块不响应
- git - git push 不要求设置上游,即使上游没有设置
- ms-word - 在 Office-js 中获取范围的周围文本
- sql - 所有字段的休眠 createQuery 联合
- django - 我们可以在 django 中将 models.Timefield 转换为 datetime
- c# - unity android build sqlite 数据库大小为零字节
- java - java 8按不同计数分组