我刚刚在Shiny.io上使用keras部署了一个Flexdashboard文本分类器,该分类器据说“成功”了,但在线应用程序不起作用:它链接到仅带有“未找到”的页面。这是完整的应用加载记录:
Preparing to deploy application...DONE
Uploading bundle for application: 857453...DONE
Deploying bundle: 2005872 for application: 857453 ...
Waiting for task: 604267183
building: Processing bundle: 2005872
building: Parsing manifest
building: Building image: 2108212
building: Installing system dependencies
building: Fetching packages
building: Building package: reticulate
building: Building package: tensorflow
building: Building package: keras
building: Installing packages
building: Installing files
building: Pushing image: 2108212
deploying: Starting instances
rollforward: Activating new instances
success: Stopping old instances
Application successfully deployed to https://xxxx.shinyapps.io/xxxx/
Warning messages:
1: invalid uid value replaced by that for user 'nobody'
2: invalid gid value replaced by that for user 'nobody'
我认为该错误与警告消息有关,但是我已经检查了日志,故障点似乎与网状结构有关:
warning: using reticulate but python was not specified; will use python at /usr/bin/python
Did you forget to set the RETICULATE_PYTHON environment variable in your .Rprofile before publishing?
我检查了本地网状结构使用的python安装:
library(reticulate)
py_config()
然后我编辑了.RProfile使其匹配:
Sys.setenv(RETICULATE_PYTHON = "/Users/xxxx/anaconda3/envs/r-tensorflow/bin/python")
但是当我在Shinyio上部署时,它仍然会产生相同的“未找到”错误。知道如何解决这个问题吗?