rstudio / tensorflow.rstudio.com

https://tensorflow.rstudio.com
9 stars 12 forks source link

RETICULATE_PYTHON and working example to deploy on shinyapps.io #74

Open vbonhomme opened 3 months ago

vbonhomme commented 3 months ago

Hi there,

(This is not exactly an issue but a request tos slightly expand an example that would be quite profitable to a lot of people I think)

The MNIST example to train model and build a shiny app from it is very clear, almost to the end to me. When deploying to shinyapps.io it is quite elusive about RETICULATE_PYTHON and .Rprofile and I'm very lost.

I have found many threads with the same problem and they pretty much all point to @ranikay example there.

I have been struggling with this four almost 4 days in a row and made ~ no advance. Would it be possible to have a reproducible example of a full shiny app running a keras model that can be deployed to shinyapps.io ? Just like what be found there but with a proper .Rprofile example, eg in a github repos?

I would be very very very happy to make it work and I feel just lost now.

Thanks a bunch in advance. All the very best.

t-kalinowski commented 3 months ago

rsconnect::deployApp() should do most of the work of inferring the Python requirements. What is the error you are seeing?

Have you seen this guide on deploying reticulate projects to Connect? It goes into more detail about how rsconnect builds a manifest. While that guide is specific to Connect, much of it is relevant to shinyapps.io.

https://solutions.posit.co/write-code/reticulate/#deploying-a-reticulated-project

vbonhomme commented 3 months ago

Hi Tomasz,

I'm basically struggling with :

2024-05-08T13:05:12.066567+00:00 shinyapps[11962088]: Warning: The reticulate package is installed but no Python environment is available.
2024-05-08T13:05:12.070258+00:00 shinyapps[11962088]: Did you forget to set the RETICULATE_PYTHON environment variable in your .Rprofile before publishing?
[...]
2024-05-08T13:05:16.047666+00:00 shinyapps[11962088]: Error in use_virtualenv("r-tensorflow", required = TRUE) : 
2024-05-08T13:05:16.051136+00:00 shinyapps[11962088]:   Directory ~/.virtualenvs/r-tensorflow is not a Python virtualenv

I'm sure I'm doing sth wrong and, as I have tried a gazillion things that did not work, I'm even more confused now... Anyway, thanks for your help.

t-kalinowski commented 3 months ago

The most straightforward approach might be to create a project local venv, and then set RETICULATE_PYTHON to point at it. In the project directory, run:

# create a virtualenv  named "venv" in the project directory
# adjust tensorflow and python versions as needed to match 
# the current versions reported by tensorflow::tf_config()
tensorflow::install_tensorflow(envname = "./venv", 
                               version = "2.15", 
                               python_version = "3.10")

# write project .Renviron
## get path to venv python executable
python <- reticulate::virtualenv_python("./venv")
cat("", sprintf("RETICULATE_PYTHON='%s'", python), "", 
    sep = "\n", 
    file = "./.Renviron", append = TRUE) 

Then restart the R session and try rsconnect::deployApp() again.

vbonhomme commented 3 months ago

Thanks a lot for your time; It's really appreciated. I think I'm the problem, still not working. Here is the full log from shinyapps.io :

2024-05-08T13:41:38.995394+00:00 shinyapps[11962289]: Container event from container-9547923: start
2024-05-08T13:41:40.988695+00:00 shinyapps[11962289]: Running on host: 60b263f4457a
2024-05-08T13:41:40.993001+00:00 shinyapps[11962289]: Running as user: uid=10001(shiny) gid=10001(shiny) groups=10001(shiny)
2024-05-08T13:41:40.997328+00:00 shinyapps[11962289]: Connect version: 2023.10.0
2024-05-08T13:41:41.001643+00:00 shinyapps[11962289]: LANG: C.UTF-8
2024-05-08T13:41:41.005752+00:00 shinyapps[11962289]: Working directory: /srv/connect/apps/mrseguinapp
2024-05-08T13:41:41.009835+00:00 shinyapps[11962289]: Using R 4.1.3
2024-05-08T13:41:41.015516+00:00 shinyapps[11962289]: R.home(): /opt/R/4.1.3/lib/R
2024-05-08T13:41:41.019995+00:00 shinyapps[11962289]: Content will use current R environment
2024-05-08T13:41:41.024284+00:00 shinyapps[11962289]: R_LIBS: (unset)
2024-05-08T13:41:41.028728+00:00 shinyapps[11962289]: .libPaths(): /usr/lib/R, /opt/R/4.1.3/lib/R/library
2024-05-08T13:41:41.033014+00:00 shinyapps[11962289]: shiny version: 1.8.1.1
2024-05-08T13:41:41.037502+00:00 shinyapps[11962289]: httpuv version: 1.6.5
2024-05-08T13:41:41.041959+00:00 shinyapps[11962289]: rmarkdown version: 2.13
2024-05-08T13:41:41.046873+00:00 shinyapps[11962289]: knitr version: 1.38
2024-05-08T13:41:41.051411+00:00 shinyapps[11962289]: jsonlite version: 1.8.8
2024-05-08T13:41:41.055884+00:00 shinyapps[11962289]: RJSONIO version: (none)
2024-05-08T13:41:41.060089+00:00 shinyapps[11962289]: htmltools version: 0.5.8.1
2024-05-08T13:41:41.064399+00:00 shinyapps[11962289]: reticulate version: 1.36.1
2024-05-08T13:41:41.070286+00:00 shinyapps[11962289]: Warning: The reticulate package is installed but no Python environment is available.
2024-05-08T13:41:41.074953+00:00 shinyapps[11962289]: Did you forget to set the RETICULATE_PYTHON environment variable in your .Rprofile before publishing?
2024-05-08T13:41:41.079123+00:00 shinyapps[11962289]: Using pandoc: /opt/connect/ext/pandoc/2.16
2024-05-08T13:41:41.083727+00:00 shinyapps[11962289]: 
2024-05-08T13:41:41.088058+00:00 shinyapps[11962289]: Starting R with process ID: '32'
2024-05-08T13:41:41.092560+00:00 shinyapps[11962289]: Shiny application starting ...
2024-05-08T13:41:41.097000+00:00 shinyapps[11962289]: Error in use_virtualenv("./venv", required = TRUE) : 
2024-05-08T13:41:41.101246+00:00 shinyapps[11962289]:   Directory ./venv is not a Python virtualenv
2024-05-08T13:41:41.105384+00:00 shinyapps[11962289]: Calls: local ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous>
2024-05-08T13:41:41.109593+00:00 shinyapps[11962289]: Execution halted
2024-05-08T13:41:41.114548+00:00 shinyapps[11962289]: Shiny application exiting ...
2024-05-08T13:41:43.112784+00:00 shinyapps[11962289]: Running on host: 60b263f4457a
2024-05-08T13:41:43.117542+00:00 shinyapps[11962289]: Running as user: uid=10001(shiny) gid=10001(shiny) groups=10001(shiny)
2024-05-08T13:41:43.122131+00:00 shinyapps[11962289]: Connect version: 2023.10.0
2024-05-08T13:41:43.126729+00:00 shinyapps[11962289]: LANG: C.UTF-8
2024-05-08T13:41:43.131212+00:00 shinyapps[11962289]: Working directory: /srv/connect/apps/mrseguinapp
2024-05-08T13:41:43.135522+00:00 shinyapps[11962289]: Using R 4.1.3
2024-05-08T13:41:43.139753+00:00 shinyapps[11962289]: R.home(): /opt/R/4.1.3/lib/R
2024-05-08T13:41:43.143989+00:00 shinyapps[11962289]: Content will use current R environment
2024-05-08T13:41:43.148428+00:00 shinyapps[11962289]: R_LIBS: (unset)
2024-05-08T13:41:43.152549+00:00 shinyapps[11962289]: .libPaths(): /usr/lib/R, /opt/R/4.1.3/lib/R/library
2024-05-08T13:41:43.157465+00:00 shinyapps[11962289]: shiny version: 1.8.1.1
2024-05-08T13:41:43.162319+00:00 shinyapps[11962289]: httpuv version: 1.6.5
2024-05-08T13:41:43.166283+00:00 shinyapps[11962289]: rmarkdown version: 2.13
2024-05-08T13:41:43.170664+00:00 shinyapps[11962289]: knitr version: 1.38
2024-05-08T13:41:43.177307+00:00 shinyapps[11962289]: jsonlite version: 1.8.8
2024-05-08T13:41:43.182488+00:00 shinyapps[11962289]: RJSONIO version: (none)
2024-05-08T13:41:43.187593+00:00 shinyapps[11962289]: htmltools version: 0.5.8.1
2024-05-08T13:41:43.191842+00:00 shinyapps[11962289]: reticulate version: 1.36.1
2024-05-08T13:41:43.196282+00:00 shinyapps[11962289]: Warning: The reticulate package is installed but no Python environment is available.
2024-05-08T13:41:43.200829+00:00 shinyapps[11962289]: Did you forget to set the RETICULATE_PYTHON environment variable in your .Rprofile before publishing?
2024-05-08T13:41:43.205275+00:00 shinyapps[11962289]: Using pandoc: /opt/connect/ext/pandoc/2.16
2024-05-08T13:41:43.210260+00:00 shinyapps[11962289]: 
2024-05-08T13:41:43.215266+00:00 shinyapps[11962289]: Starting R with process ID: '51'
2024-05-08T13:41:43.219440+00:00 shinyapps[11962289]: Shiny application starting ...
2024-05-08T13:41:44.991331+00:00 shinyapps[11962289]: Error in use_virtualenv("./venv", required = TRUE) : 
2024-05-08T13:41:44.996358+00:00 shinyapps[11962289]:   Directory ./venv is not a Python virtualenv
2024-05-08T13:41:45.000633+00:00 shinyapps[11962289]: Calls: local ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous>
2024-05-08T13:41:45.004824+00:00 shinyapps[11962289]: Execution halted
2024-05-08T13:41:45.010499+00:00 shinyapps[11962289]: Shiny application exiting ...

My .Rprofile is empty. My .Renviron contains my "local" RETICULATE_PYTHON ie: RETICULATE_PYTHON='/Users/vbonhomme/Research/MrSeguinApp/venv/bin/python' .

I have run this:

# create a virtualenv  named "venv" in the project directory
# adjust tensorflow and python versions as needed to match
# the current versions reported by tensorflow::tf_config()
tensorflow::install_tensorflow(envname = "./venv",
                               version = "2.16.1",
                               python_version = "3.12")

# write project .Renviron
## get path to venv python executable
python <- reticulate::virtualenv_python("./venv")
cat("", sprintf("RETICULATE_PYTHON='%s'", python), "",
    sep = "\n",
    file = "./.Renviron", append = TRUE)

and my app.R begins like this:


library(reticulate)
# virtualenv_create('r-tensorflow', packages=c("pip", "numpy", "keras"))
use_virtualenv('./venv', required = TRUE)

To be honest, I really begin to think I have no idea what I'm doing :-)

t-kalinowski commented 3 months ago

@kevinushey do you know what might be going wrong?

@vbonhomme What does rsconnect::writeManifest() produce?

You can try removing the use_virtualenv('./venv', required = TRUE) line, it's no longer necessary if RETICULATE_PYTHON is set, and might be interfering here.

vbonhomme commented 3 months ago

thanks guys for giving a hand on this ! 💪

I have tried without the use_virtualenv('./venv', required = TRUE) line and now the shinyapps.io logs says :

2024-05-08T16:10:23.074343+00:00 shinyapps[11962289]: Error in py_discover_config(required_module, use_environment) : 
2024-05-08T16:10:23.078331+00:00 shinyapps[11962289]:   Python specified in RETICULATE_PYTHON (/Users/vbonhomme/Research/MrSeguinApp/venv/bin/python) does not exist

and still :

2024-05-08T16:10:21.108337+00:00 shinyapps[11962289]: Warning: The reticulate package is installed but no Python environment is available. 2024-05-08T16:10:21.113036+00:00 shinyapps[11962289]: Did you forget to set the RETICULATE_PYTHON environment variable in your .Rprofile before publishing? slightly above.

From what I understand, the former tends to make sense because that's the line I have in my .Renviron, and is my local path to python. Apparently it requires the python path on the shinyapps.io server. The latter is what pointed me at first towards @ranikay example there workaround, with no success.

The result of rsconnect::writeManifest() is :

ℹ Capturing R dependencies with renv
✔ Found 131 dependencies
```  on the console, and in the "rsconnect/shinyapps.io/grmoex/mrseguinapp.dcf" file there are these lines : 

name: mrseguinapp
title: MrSeguinApp
username: grmoex
account: grmoex
server: shinyapps.io
hostUrl: https://api.shinyapps.io/v1
appId: 11962289
bundleId: 8592591
url: https://grmoex.shinyapps.io/mrseguinapp/
version: 1
asMultiple: FALSE
asStatic: FALSE

I'm tempted by black magic now :-)

To give a bit more of context, I'm working on sth on the lines of this preprint with a generic app to make binary predictions (mostly targeted at archaeological biological material). I use a pretrained VGG16 model on which on top of it I added a couple of final layers to make the prediction. Having such an app working would be a real game changer for us mere mortals dealing with old remains of domesticated plants/animals and I would be eternally grateful. 🐑 🐐 🌴 🍇 👍

vbonhomme commented 3 months ago

I realize you probably mean this manifest (the first lines) !

{
  "version": 1,
  "locale": "en_US",
  "platform": "4.1.3",
  "metadata": {
    "appmode": "shiny",
    "primary_rmd": null,
    "primary_html": null,
    "content_category": null,
    "has_parameters": false
  },
  "python": {
    "version": "3.12.2",
    "package_manager": {
      "name": "pip",
      "version": "24.0",
      "package_file": "requirements.txt"
    }
  },
  "packages": {
    "DBI": {
      "Source": "CRAN",
      "Repository": "https://cran.rstudio.com",
      "description": {
        "Package": "DBI",
        "Title": "R Database Interface",
        "Version": "1.2.2",
        "Date": "2024-02-09",
        "Authors@R": "c(\n    person(\"R Special Interest Group on Databases (R-SIG-DB)\", role = \"aut\"),\n    person(\"Hadley\", \"Wickham\", role = \"aut\"),\n    person(\"Kirill\", \"Müller\", , \"kirill@cynkra.com\", role = c(\"aut\", \"cre\"),\n           comment = c(ORCID = \"0000-0002-1416-3412\")),\n    person(\"R Consortium\", role = \"fnd\")\n  )",
        "Description": "A database interface definition for communication between R\n    and relational database management systems.  All classes in this\n    package are virtual and need to be extended by the various R/DBMS\n    implementations.",
        "License": "LGPL (>= 2.1)",
        "URL": "https://dbi.r-dbi.org, https://github.com/r-dbi/DBI",
        "BugReports": "https://github.com/r-dbi/DBI/issues",
        "Depends": "methods, R (>= 3.0.0)",
        "Suggests": "arrow, blob, covr, DBItest, dbplyr, downlit, dplyr, glue,\nhms, knitr, magrittr, nanoarrow (>= 0.3.0.1), RMariaDB,\nrmarkdown, rprojroot, RSQLite (>= 1.1-2), testthat (>= 3.0.0),\nvctrs, xml2",
        "VignetteBuilder": "knitr",
        "Config/autostyle/scope": "line_breaks",
        "Config/autostyle/strict": "false",
        "Config/Needs/check": "r-dbi/DBItest",
        "Encoding": "UTF-8",
        "RoxygenNote": "7.3.0.9000",
        "Config/Needs/website": "r-dbi/DBItest, r-dbi/dbitemplate, adbi,\nAzureKusto, bigrquery, DatabaseConnector, dittodb, duckdb,\nimplyr, lazysf, odbc, pool, RAthena, IMSMWU/RClickhouse, RH2,\nRJDBC, RMariaDB, RMySQL, RPostgres, RPostgreSQL, RPresto,\nRSQLite, sergeant, sparklyr, withr",
        "Config/testthat/edition": "3",
        "NeedsCompilation": "no",
        "Packaged": "2024-02-09 07:30:24 UTC; kirill",
        "Author": "R Special Interest Group on Databases (R-SIG-DB) [aut],\n  Hadley Wickham [aut],\n  Kirill Müller [aut, cre] (<https://orcid.org/0000-0002-1416-3412>),\n  R Consortium [fnd]",
        "Maintainer": "Kirill Müller <kirill@cynkra.com>",
        "Repository": "CRAN",
        "Date/Publication": "2024-02-16 13:00:02 UTC",
        "Built": "R 4.1.3; ; 2024-04-13 22:38:39 UTC; unix"
      }
    },
    "MASS": {
      "Source": "CRAN",
      "Repository": "https://cran.rstudio.com",
      "description": {
        "Package": "MASS",
        "Priority": "recommended",
        "Version": "7.3-55",
        "Date": "2022-01-12",
        "Revision": "$Rev: 3559 $",
        "Depends": "R (>= 3.3.0), grDevices, graphics, stats, utils",
        "Imports": "methods",
        "Suggests": "lattice, nlme, nnet, survival",
        "Authors@R": "c(person(\"Brian\", \"Ripley\", role = c(\"aut\", \"cre\", \"cph\"),\n                    email = \"ripley@stats.ox.ac.uk\"),\n\t     person(\"Bill\", \"Venables\", role = \"ctb\"),\n\t     person(c(\"Douglas\", \"M.\"), \"Bates\", role = \"ctb\"),\n\t     person(\"Kurt\", \"Hornik\", role = \"trl\",\n                     comment = \"partial port ca 1998\"),\n\t     person(\"Albrecht\", \"Gebhardt\", role = \"trl\",\n                     comment = \"partial port ca 1998\"),\n\t     person(\"David\", \"Firth\", role = \"ctb\"))",
        "Description": "Functions and datasets to support Venables and Ripley,\n  \"Modern Applied Statistics with S\" (4th edition, 2002).",
        "Title": "Support Functions and Datasets for Venables and Ripley's MASS",
        "LazyData": "yes",
        "ByteCompile": "yes",
        "License": "GPL-2 | GPL-3",
        "URL": "http://www.stats.ox.ac.uk/pub/MASS4/",
        "Contact": "<MASS@stats.ox.ac.uk>",
        "NeedsCompilation": "yes",
        "Packaged": "2022-01-13 05:06:37 UTC; ripley",
        "Author": "Brian Ripley [aut, cre, cph],\n  Bill Venables [ctb],\n  Douglas M. Bates [ctb],\n  Kurt Hornik [trl] (partial port ca 1998),\n  Albrecht Gebhardt [trl] (partial port ca 1998),\n  David Firth [ctb]",
        "Maintainer": "Brian Ripley <ripley@stats.ox.ac.uk>",
        "Repository": "CRAN",
        "Date/Publication": "2022-01-16 10:24:09 UTC",
        "Built": "R 4.1.3; x86_64-apple-darwin17.0; 2022-03-11 01:18:17 UTC; unix"
      }
    },
    "Matrix": {
      "Source": "CRAN",
      "Repository": "https://cran.rstudio.com",
      "description": {
        "Package": "Matrix",
        "Version": "1.4-0",
        "Date": "2021-12-08",
        "Priority": "recommended",
        "Title": "Sparse and Dense Matrix Classes and Methods",
        "Contact": "Doug and Martin <Matrix-authors@R-project.org>",
        "Maintainer": "Martin Maechler <mmaechler+Matrix@gmail.com>",
        "Authors@R": "c(person(\"Douglas\",\"Bates\", role=\"aut\")\n , person(\"Martin\",\"Maechler\", role = c(\"aut\",\"cre\"), email=\"mmaechler+Matrix@gmail.com\",\n          comment = c(ORCID = \"0000-0002-8685-9910\"))\n , person(\"Timothy A.\", \"Davis\", role=\"ctb\",\n           comment = c(\"SuiteSparse and 'cs' C libraries, notably CHOLMOD, AMD;\n\t\t       collaborators listed in\n\t\t\tdir(pattern = '^[A-Z]+[.]txt$', full.names=TRUE,\n\t\t\t    system.file('doc', 'SuiteSparse', package='Matrix'))\"))\n , person(\"Jens\", \"Oehlschlägel\", role=\"ctb\", comment=\"initial nearPD()\")\n , person(\"Jason\", \"Riedy\", role=\"ctb\",\n          comment = c(\"condest() and onenormest() for octave\",\n \t  \t      \"Copyright: Regents of the University of California\"))\n , person(\"R Core Team\", role = \"ctb\", comment=\"base R matrix implementation\")\n )",
        "Description": "A rich hierarchy of matrix classes, including triangular,\n   symmetric, and diagonal matrices, both dense and sparse and with\n   pattern, logical and numeric entries.   Numerous methods for and\n   operations on these matrices, using 'LAPACK' and 'SuiteSparse' libraries.",
        "Depends": "R (>= 3.5.0)",
        "Imports": "methods, graphics, grid, stats, utils, lattice",
        "Suggests": "expm, MASS",
        "Enhances": "MatrixModels, graph, SparseM, sfsmisc, igraph, maptools, sp,\nspdep",
        "EnhancesNote": "line 2: for \"Rd xrefs\"",
        "Encoding": "UTF-8",
        "LazyData": "no",
        "LazyDataNote": "not possible, since we use data/*.R *and* our classes",
        "BuildResaveData": "no",
        "License": "GPL (>= 2) | file LICENCE",
        "URL": "https://Matrix.R-forge.R-project.org/,\nhttps://Matrix.R-forge.R-project.org/doxygen/",
        "BugReports": "https://R-forge.R-project.org/tracker/?atid=294?group_id=61",
        "Author": "Douglas Bates [aut],\n  Martin Maechler [aut, cre] (<https://orcid.org/0000-0002-8685-9910>),\n  Timothy A. Davis [ctb] (SuiteSparse and 'cs' C libraries, notably\n    CHOLMOD, AMD; collaborators listed in dir(pattern =\n    '^[A-Z]+[.]txt$', full.names=TRUE, system.file('doc',\n    'SuiteSparse', package='Matrix'))),\n  Jens Oehlschlägel [ctb] (initial nearPD()),\n  Jason Riedy [ctb] (condest() and onenormest() for octave, Copyright:\n    Regents of the University of California),\n  R Core Team [ctb] (base R matrix implementation)",
        "Repository": "CRAN",
        "Repository/R-Forge/Project": "matrix",
        "Repository/R-Forge/Revision": "3419",
        "Repository/R-Forge/DateTimeStamp": "2021-12-08 17:23:53",
        "Date/Publication": "2021-12-08 21:10:02 UTC",
        "NeedsCompilation": "yes",
        "Packaged": "2021-12-08 17:30:00 UTC; rforge",
        "Built": "R 4.1.3; x86_64-apple-darwin17.0; 2022-03-11 01:18:26 UTC; unix"
      }
    },

and also the requirements.txt in case it helps:

# requirements.txt generated by rsconnect-python on 2024-05-08 16:01:45.885948
absl-py==2.1.0
astunparse==1.6.3
certifi==2024.2.2
charset-normalizer==3.3.2
flatbuffers==24.3.25
gast==0.5.4
google-pasta==0.2.0
grpcio==1.63.0
h5py==3.11.0
idna==3.7
keras==3.3.3
libclang==18.1.1
Markdown==3.6
markdown-it-py==3.0.0
MarkupSafe==2.1.5
mdurl==0.1.2
ml-dtypes==0.3.2
namex==0.0.8
numpy==1.26.4
opt-einsum==3.3.0
optree==0.11.0
packaging==24.0
pip==24.0
protobuf==4.25.3
Pygments==2.18.0
requests==2.31.0
rich==13.7.1
setuptools==69.5.1
six==1.16.0
tensorboard==2.16.2
tensorboard-data-server==0.7.2
tensorflow==2.16.1
termcolor==2.4.0
typing_extensions==4.11.0
urllib3==2.2.1
Werkzeug==3.0.3
wheel==0.43.0
wrapt==1.16.0
ssinnott commented 3 months ago

Hello! Just to chime in from the shinyapps.io side of the fence I think this is a limitation with our service and not the reticulate package. There are work arounds that people in the community have found (like the ones linked above) but they are very awkward and have various limitations.

We have an issue open on our end to add more explicit reticulate support and I'll reply back here when that work is completed. If you have a paid shinyapps.io subscription it would be better for tracking purposes to open a support case with us rather than an issue on this repository.

vbonhomme commented 3 months ago

@ssinnott thanks for this ! Do you think I'd help to have a paid subscription. I'll need one anyway in a next future but I'd like to be sure we can found a workaround.

Not even sure the problem is python per se as the example above works like a charm, also with useful inputs in the second tab : https://grmoex.shinyapps.io/shiny-reticulate-app-1/ but as soon as I start trying to library(keras) (just this, not even loading models or whatever) things are messed up and the server will soon disconnect. I may not understand 10% of all what's going on behind the curtain on shinyapps.io, but still, this is quite strange to me :-)

vbonhomme commented 3 months ago

(update. I can run the app with keras.)

vbonhomme commented 1 month ago

Hi there,

I'm just conjuring if you have any updates on this?

All the very best

Le jeu. 9 mai 2024 à 15:24, Sean Sinnott @.***> a écrit :

Hello! Just to chime in from the shinyapps.io side of the fence I think this is a limitation with our service and not the reticulate package. There are work arounds that people in the community have found like the ones linked above but they are very awkward and have various limitations.

We have an issue open on our end to add more explicit reticulate support and I'll reply back here when that work is completed. If you have a paid shinyapps.io subscription it would be better for tracking purposes to open a support case with us rather than an issue on this repository.

— Reply to this email directly, view it on GitHub https://github.com/rstudio/tensorflow.rstudio.com/issues/74#issuecomment-2102657512, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABECQFRNKN7G7GLXPU5XTWTZBN2IRAVCNFSM6AAAAABHM2NRUWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBSGY2TONJRGI . You are receiving this because you were mentioned.Message ID: @.***>

-- vincentbonhomme.fr http://www.vincentbonhomme.fr cevennette.fr https://www.cevennette.fr 🌱

t-kalinowski commented 1 month ago

I don't think there has been any updates on the shinyapps.io + reticulate front. However, somewhat recently, Connect has gained the ability to serve Keras exported models via export_savedmodel(); rsconnect::deployTFModel().

bibibiwen commented 3 weeks ago

I had the same problem in deploying my shinyapp via shinyapps.io using python module. The same error in the logs. I followed the most mentioned tutorial @ranikay and i even tried to reproduce the project but failed with the same error as my own shinyapp. It seems that the comman in R.profile running before the creating virtualenvs so that it cannot find the RETICULATE_PYTHON. I am losting for a week. Capture