Problem deploying shiny app with Keras and CNTK backend to shinyapps.io

shinyappsio
keras

#1

Problem deploying a shiny app with Keras and CNTK backend to shinyapps.io website. The app runs fine in local RStudio. The deployment is fine too. However, it doesn't run properly on the website. This app simply loads a saved model trained under Keras+CNTK, and plot a surface. In the code, I used

library(keras)
use_backend("cntk")

In the server log, I see the following error. (More detailed log can be provided if needed)

"Warning: Error in : ImportError: No module named cntk"

Thanks.

Jay


#2

shinyapps.io doesn't have CNTK pre-installed, however it does have TensorFlow. Would it be okay to use the TensorFlow backend instead?


#3

The app needs to read a keras+cntk pre-trained model. (The reason i used cntk is that tensorflow has some weird reproducibility issues even after I tried various techniques here.) This tool may help me to convert saved cntk models to tensorflow ones (haven't tried yet), but it would be much convenient if the shinyapp platform can have cntk pre-installed. Thanks.


#4

keras+tensorflow actually can load the models saved in keras+cntk. The "save" and "load" functions are implemented in keras after all. I was confused before by another bug in my code (filename problem, Windows is not case sensitive, but shinapps web platform is Linux). My problem has been solved. Thanks.


#5

If your question's been answered (even by you!), would you mind choosing a solution? It helps other people see which questions still need help, or find solutions if they have similar problems. Here’s how to do it: