首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Azure:如何使用tensorflow部署函数应用程序

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

Stack Overflow用户
提问于 2022-09-12 23:16:34
回答 1查看 153关注 0票数 0

我正在尝试将微软的TensorFlow示例部署到azure (它在本地工作)。我所做的唯一改变是对requirements.txt中的requirements.txt版本进行了修改。由于出现了错误,所以我没有指定一个版本,而是将其保留为空白:

错误:无法找到满足tensorflow==1.14要求的版本(来自-r requirements.txt (第4行))(版本: 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)

代码语言:javascript
运行
复制
azure-functions
#tensorflow==1.14
tensorflow
Pillow
requests

一旦添加了TensorFlow需求,部署就会失败:

代码语言:javascript
运行
复制
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代码中的集成工具来执行发布。使用CLI,我得到了相同的结果:

代码语言:javascript
运行
复制
>>> 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!
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-09-13 14:06:34

您需要指定tensorflow 2.8,它解决了我的问题。在函数requirements.txt文件中,将"tensorflow==2.8.0“改为"tensorflow”

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/73696134

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档