Hello,
Have been playing around with dogs and cats data set. I successfully built a Keras Classification CNN. So far so good.
Then I created a shiny app.... and it runs ok, locally!
When I try to publish the app (shinyapps.io), it seems that everything goes well. Though, when I open the deployed app I receive this:
I have to say that I am puzzled by the this message. I believe that it has something to do with path and/or with the environments (or not!), but can't find a solution.
You need to set up your virtual invironment properly to let shinyapps.io know that you are using python. Did you add the Rprofile file with all the settings to your app?
Have a look at this example app and tutorial:
What your could do is clone the repository and see if you are able to deploy the example app to shinyapps.io. If it works simply replace the code in the App file with your own.
Hello @noveld thanks for your reply,
I was not aware of the need to have the Rprofile. I am new to all the interface architecture, virtual environments etc... currently I am using a miniconda setup.
I tried your suggestion and publishing in shinyapps.io that app was no problem. All good! So I created a virtual environment with reticulate, but when then try to publish my app, it seems that it lacks Keras and Tensorflow in that same environmnent. Then, from what I was able to get it seems that, it is not possible to do it in a windows machine (which I have). I got that here: https://tensorflow.rstudio.com/reference/keras/install_keras/
If it works locally I don't think you have an issue with your installation of keras or tensorflow.
Now that you set your Rprofile did the error messages disappear? What does the log file show?
Another problem might be that the file path for your model is wrong. Did you put the file in the www folder? Maybe put a text file or image in the same location and see if it loads when you deploy to shinyapps.io
Traceback (most recent call last):
File "C:\Users\PEDRO~1.DAV\AppData\Local\R-MINI~1\envs\R-RETI~1\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "C:\Users\PEDRO~1.DAV\AppData\Local\R-MINI~1\envs\R-RETI~1\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Users\PEDRO~1.DAV\DOCUME~1\VIRTUA~1\PYTHON~1\lib\site-packages\pip\__main__.py", line 23, in <module>
from pip._internal.cli.main import main as _main # isort:skip # noqa
File "C:\Users\PEDRO~1.DAV\DOCUME~1\VIRTUA~1\PYTHON~1\lib\site-packages\pip\_internal\cli\main.py", line 10, in <module>
from pip._internal.cli.autocompletion import autocomplete
File "C:\Users\PEDRO~1.DAV\DOCUME~1\VIRTUA~1\PYTHON~1\lib\site-packages\pip\_internal\cli\autocompletion.py", line 9, in <module>
from pip._internal.cli.main_parser import create_main_parser
File "C:\Users\PEDRO~1.DAV\DOCUME~1\VIRTUA~1\PYTHON~1\lib\site-packages\pip\_internal\cli\main_parser.py", line 7, in <module>
from pip._internal.cli import cmdoptions
File "C:\Users\PEDRO~1.DAV\DOCUME~1\VIRTUA~1\PYTHON~1\lib\site-packages\pip\_internal\cli\cmdoptions.py", line 25, in <module>
from pip._internal.cli.progress_bars import BAR_TYPES
File "C:\Users\PEDRO~1.DAV\DOCUME~1\VIRTUA~1\PYTHON~1\lib\site-packages\pip\_internal\cli\progress_bars.py", line 12, in <module>
from pip._internal.utils.logging import get_indentation
File "C:\Users\PEDRO~1.DAV\DOCUME~1\VIRTUA~1\PYTHON~1\lib\site-packages\pip\_internal\utils\logging.py", line 18, in <module>
from pip._internal.utils.misc import ensure_dir
File "C:\Users\PEDRO~1.DAV\DOCUME~1\VIRTUA~1\PYTHON~1\lib\site-packages\pip\_internal\utils\misc.py", line 34, in <module>
from pip._internal.locations import get_major_minor_version, site_packages, user_site
File "C:\Users\PEDRO~1.DAV\DOCUME~1\VIRTUA~1\PYTHON~1\lib\site-packages\pip\_internal\locations.py", line 68, in <module>
if platform.python_implementation().lower() == "pypy":
File "C:\Users\PEDRO~1.DAV\AppData\Local\R-MINI~1\envs\R-RETI~1\lib\platform.py", line 1267, in python_implementation
return _sys_version()[0]
File "C:\Users\PEDRO~1.DAV\AppData\Local\R-MINI~1\envs\R-RETI~1\lib\platform.py", line 1225, in _sys_version
repr(sys_version))
ValueError: failed to parse CPython sys.version: '3.6.10 |Anaconda, Inc.| (default, May 7 2020, 19:46:08) [MSC v.1916 64 bit (AMD64)]'
Error: Error installing package(s): "numpy"
I am sorry I don't really know what the problem could be. Maybe try to post your error log together with your Rprofile on stackoverflow.com. Maybe you have more luck there finding an answer.