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

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

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

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.

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.

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:

1 Like