Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for keras models #164

Merged
merged 41 commits into from
Feb 7, 2023
Merged

Add support for keras models #164

merged 41 commits into from
Feb 7, 2023

Conversation

juliasilge
Copy link
Member

@juliasilge juliasilge commented Nov 21, 2022

Addresses #144

@juliasilge juliasilge marked this pull request as ready for review January 14, 2023 00:12
R/keras.R Outdated Show resolved Hide resolved
R/keras.R Outdated Show resolved Hide resolved
avoid implicit promotion of `y` from a 1d array to 2d array
R/keras.R Outdated Show resolved Hide resolved
R/keras.R Outdated Show resolved Hide resolved
tests/testthat/helper-redact.R Outdated Show resolved Hide resolved
@juliasilge
Copy link
Member Author

Thank you again for this review @t-kalinowski! I outlined some of where we are and where we might head from here in #55. To sum up:

  • This now errors on creating the vetiver_model() object for multi-input keras models, because the current strategy for the POST endpoint will not handle that well. Let's hear from users about how important this is.
  • The default behavior is to require the user to pass in some prototype_data (this is similar to ranger and all of the Python implementation) or to explicitly turn off checking of new data with save_prototype = FALSE. If someone wants to build a model with non-rectangular data like images, this is currently what they will have to do. Again, let's hear from users about how important this is and what they want to do.

@juliasilge
Copy link
Member Author

juliasilge commented Jan 26, 2023

I have made some good headway on how to deploy this to Connect today. Some notes:

  • The automatic dependency discovery for Python didn't work for me at all, I think because I am on an M1 and all my TensorFlow stuff is specific for ARM architecture. I could solve this by deploying the plumber file together with a minimal requirements.txt:
keras
tensorflow

I did successfully deploy a model! 🎉

  • Sadly, the model can't predict. 😞 From the logs, I suspect that the problem is that I trained and serialized the model on my M1. For the next step, I am going to try to train the model on Colorado Workbench and then deploy from there. I'm currently having trouble installing TensorFlow on Workbench, however.

@juliasilge
Copy link
Member Author

Still TODO: create a minimal requirements.txt to deploy with the plumber.R for Connect.

@juliasilge
Copy link
Member Author

This is working now on Connect, I believe!
https://colorado.posit.co/rsc/content/9c37e89e-c094-41b8-813c-2f636dd98e51

I will work on a Docker container in a different PR.

@juliasilge juliasilge mentioned this pull request Feb 7, 2023
@juliasilge juliasilge merged commit 06f3a15 into main Feb 7, 2023
@juliasilge juliasilge deleted the add-keras branch February 7, 2023 23:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants