gpt4 book ai didi

Azure:如何使用tensorflow部署函数应用程序

转载 作者:行者123 更新时间:2023-12-02 07:42:28 33 4
gpt4 key购买 nike

我正在尝试部署the TensorFlow sample from Microsoft到 azure (它在本地工作)。我所做的唯一更改是requirements.txt 中的TensorFlow 版本。我没有指定版本,而是将其留空,因为出现了错误:

ERROR: Could not find a version that satisfies the requirementtensorflow==1.14 (from -r requirements.txt (line 4)) (from versions:2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.6.0rc0, 2.6.0rc1, 2.6.0rc2, 2.6.0, 2.6.1, 2.6.2, 2.6.3, 2.6.4, 2.6.5, 2.7.0rc0, 2.7.0rc1, 2.7.0, 2.7.1, 2.7.2, 2.7.3, 2.7.4, 2.8.0rc0, 2.8.0rc1, 2.8.0, 2.8.1, 2.8.2, 2.8.3, 2.9.0rc0, 2.9.0rc1, 2.9.0rc2, 2.9.0, 2.9.1, 2.9.2, 2.10.0rc0, 2.10.0rc1, 2.10.0rc2, 2.10.0rc3, 2.10.0)

azure-functions
#tensorflow==1.14
tensorflow
Pillow
requests

添加TensorFlow需求后部署不成功:

01:06:17 Test19542413: Starting deployment...
01:06:19 Test19542413: Creating zip package...
01:06:20 Test19542413: Zip package size: 4.69 MB
01:06:24 Test19542413: Updating submodules.
01:06:25 Test19542413: Preparing deployment for commit id 'b2f177b6-7'.
01:06:25 Test19542413: PreDeployment: context.CleanOutputPath False
01:06:25 Test19542413: PreDeployment: context.OutputPath /home/site/wwwroot
01:06:25 Test19542413: Repository path is /tmp/zipdeploy/extracted
01:06:25 Test19542413: Running oryx build...
01:06:25 Test19542413: Command: oryx build /tmp/zipdeploy/extracted -o /home/site/wwwroot --platform python --platform-version 3.9.7 -p packagedir=.python_packages/lib/site-packages
01:06:27 Test19542413: Operation performed by Microsoft Oryx, https://github.com/Microsoft/Oryx
01:06:27 Test19542413: You can report issues at https://github.com/Microsoft/Oryx/issues
01:06:27 Test19542413: Oryx Version: 0.2.20210120.1, Commit: 66c7820d7df527aaffabd2563a49ad57930999c9, ReleaseTagName: 20210120.1
01:06:27 Test19542413: Build Operation ID: |F+eWRyTKD/s=.b5e2f596_
01:06:27 Test19542413: Repository Commit : b2f177b6-7c7f-4747-bc49-052de459bfcb
01:06:27 Test19542413: Detecting platforms...
01:06:27 Test19542413: Detected following platforms:
01:06:27 Test19542413: python: 3.9.7
01:06:28 Test19542413: Source directory : /tmp/zipdeploy/extracted
01:06:28 Test19542413: Destination directory: /home/site/wwwroot
01:06:28 Test19542413: Python Version: /tmp/oryx/platforms/python/3.9.7/bin/python3.9
01:06:28 Test19542413: Running pip install...
01:06:29 Test19542413: [23:06:29+0000] Collecting azure-functions
01:06:29 Test19542413: [23:06:29+0000] Using cached azure_functions-1.11.2-py3-none-any.whl (206 kB)
01:06:29 Test19542413: [23:06:29+0000] Collecting tensorflow
01:06:29 Test19542413: [23:06:29+0000] Downloading tensorflow-2.10.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (578.1 MB)
01:06:40 Test19542413: Done in 12 sec(s).
01:06:42 Test19542413: /opt/Kudu/Scripts/starter.sh oryx build /tmp/zipdeploy/extracted -o /home/site/wwwroot --platform python --platform-version 3.9.7 -p packagedir=.python_packages/lib/site-packages
01:06:42 Test19542413: Generating summary of Oryx build
01:06:42 Test19542413: Deployment Log file does not exist in /tmp/oryx-build.log
01:06:42 Test19542413: The logfile at /tmp/oryx-build.log is empty. Unable to fetch the summary of build
01:06:42 Test19542413: Deployment Failed. deployer = Push-Deployer deploymentPath = Functions App ZipDeploy. Extract zip. Remote build.
01:06:46 Test19542413: Deployment failed.

不幸的是,错误消息没有给我任何关于如何解决此问题的提示。你有什么主意吗?我使用 VS Code 中的集成工具来执行发布。使用 CLI,我得到了相同的结果:

>>> func azure functionapp publish Test19542413

Getting site publishing info...
Creating archive for current directory...
Performing remote build for functions project.
Deleting the old .python_packages directory
Uploading 4,47 MB [###############################################################################]
Remote build in progress, please wait...
Updating submodules.
Preparing deployment for commit id '5eec9b3a-6'.
PreDeployment: context.CleanOutputPath False
PreDeployment: context.OutputPath /home/site/wwwroot
Repository path is /tmp/zipdeploy/extracted
Running oryx build...
Command: oryx build /tmp/zipdeploy/extracted -o /home/site/wwwroot --platform python --platform-version 3.9.7 -p packagedir=.python_packages/lib/site-packages
Operation performed by Microsoft Oryx, https://github.com/Microsoft/Oryx
You can report issues at https://github.com/Microsoft/Oryx/issues

Oryx Version: 0.2.20210120.1, Commit: 66c7820d7df527aaffabd2563a49ad57930999c9, ReleaseTagName: 20210120.1

Build Operation ID: |RM3MxQKeUzo=.1973e39e_
Repository Commit : 5eec9b3a-6c81-4f46-a4af-1989f39a3d6e

Detecting platforms...
Detected following platforms:
python: 3.9.7


Source directory : /tmp/zipdeploy/extracted
Destination directory: /home/site/wwwroot

Python Version: /tmp/oryx/platforms/python/3.9.7/bin/python3.9

Running pip install...
[13:04:20+0000] Collecting azure-functions
[13:04:20+0000] Using cached azure_functions-1.11.2-py3-none-any.whl (206 kB)
[13:04:20+0000] Collecting tensorflow
[13:04:20+0000] Downloading tensorflow-2.10.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (578.1 MB)
Done in 12 sec(s).
\n/opt/Kudu/Scripts/starter.sh oryx build /tmp/zipdeploy/extracted -o /home/site/wwwroot --platform python --platform-version 3.9.7 -p packagedir=.python_packages/lib/site-packages

Generating summary of Oryx build
Deployment Log file does not exist in /tmp/oryx-build.log
The logfile at /tmp/oryx-build.log is empty. Unable to fetch the summary of build
Deployment Failed. deployer = Push-Deployer deploymentPath = Functions App ZipDeploy. Extract zip. Remote build.
Remote build failed!

最佳答案

您需要指定tensorflow 2.8,这为我解决了问题。在函数requirements.txt文件中输入“tensorflow==2.8.0”,而不仅仅是“tensorflow”

关于Azure:如何使用tensorflow部署函数应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73696134/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com