简体   繁体   English

Azure - 如何从 Azure Databricks 文件存储下载文件?

[英]Azure - How to dowload a file from Azure Databricks Filestore?

I trained a model in using Keras on Azure databricks (notebook).我在 Azure 数据块(笔记本)上使用 Keras 训练了一个模型。 I would like to be able to save this model on an .h5 or .pkl file and download it to my local machine.我希望能够将此模型保存在 .h5 或 .pkl 文件中并将其下载到我的本地机器上。

When I train the model locally I use the following to save the file inside a directory called models, but obviously this path does not exist on Azure.当我在本地训练模型时,我使用以下命令将文件保存在名为 models 的目录中,但显然 Azure 上不存在此路径。

model.save('models/cnn_w2v.h5')

I am new to Azure so any help will be greatly appreciated我是 Azure 的新手,因此将不胜感激任何帮助

Correct me if I'm wrong, you are executing this line on your DataBricks notebook:如果我错了,请纠正我,您正在 DataBricks 笔记本上执行此行:

model.save('models/cnn_w2v.h5')

Right?对?

So if that's the case, your model is saved, but it is stored on the Azure instance that is running behind.因此,如果是这种情况,您的模型将被保存,但它存储在后面运行的 Azure 实例上。

You need to upload this file to Azure Storage (just add code to the notebook that does that).您需要将此文件上传到 Azure 存储(只需将代码添加到执行此操作的笔记本中)。

Later, you will be able to download it to your local machine.稍后,您将能够将其下载到本地计算机。

I have found the answer to my question above here: how to download files from azure databricks file store我在这里找到了上面问题的答案: 如何从 azure databricks 文件存储下载文件

Files stored in /FileStore are accessible in your web browser at https://.cloud.databricks.com/files/.存储在 /FileStore 中的文件可在您的 Web 浏览器中访问,网址为 https://.cloud.databricks.com/files/。 For example, the file you stored in /FileStore/my-stuff/my-file.txt is accessible at:例如,您存储在 /FileStore/my-stuff/my-file.txt 中的文件可在以下位置访问:

"https://.cloud.databricks.com/files/my-stuff/my-file.txt" “https://.cloud.databricks.com/files/my-stuff/my-file.txt”

Note If you are on Community Edition you may need to replace https://community.cloud.databricks.com/files/my-stuff/my-file.txt with https://community.cloud.databricks.com/files/my-stuff/my-file.txt?o=######where the number after o= is the same as in your Community Edition URL.注意如果您使用的是社区版,则可能需要将https://community.cloud.databricks.com/files/my-stuff/my-file.txt替换为https://community.cloud.databricks.com/files/ my-stuff/my-file.txt?o=######其中o= 之后的数字与您的社区版 URL 的数字相同。

Refer: https://docs.databricks.com/user-guide/advanced/filestore.html参考: https : //docs.databricks.com/user-guide/advanced/filestore.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 将文件从 Azure 文件加载到 Azure Databricks - Load file from Azure Files to Azure Databricks 如何从 /Filestore/tables/ 目录中的 databricks 中使用 pandad pd.read_excel 读取 excel 文件? - how to read an excel file using pandad pd.read_excel in databricks from /Filestore/tables/ directory? 来自 Databricks 的文件元数据,例如 timein Azure 存储 - File metadata such as timein Azure Storage from Databricks 直接从 Azure Databricks 访问 Azure DevOps Git 文件 - Accessing Azure DevOps Git file directly from Azure Databricks 如何从Azure Data Lake Store中读取Azure Databricks中的JSON文件 - How to read a JSON file in Azure Databricks from Azure Data Lake Store 如何使用Python从Azure Databricks插入Azure SQL数据库 - How to INSERT INTO Azure SQL database from Azure Databricks in Python 从Azure数据块到Azure表存储的Connectiong - Connectiong to Azure table storage from Azure databricks 从数据块连接到 azure 突触 - Connection from databricks to azure synapse 使用python和scala重命名Azure / databricks的输出文件 - Using python and scala to rename output file from azure/databricks 从数据湖重命名 Azure Databricks 中的文件时出现问题 - Problem when rename file in Azure Databricks from a data lake
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM