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

Deprecated use of keras causes error in example code. #486

Open
m-r-munroe opened this issue Sep 27, 2021 · 1 comment
Open

Deprecated use of keras causes error in example code. #486

m-r-munroe opened this issue Sep 27, 2021 · 1 comment
Labels
docs Improvements to documentation

Comments

@m-r-munroe
Copy link

m-r-munroe commented Sep 27, 2021

I went to here to work through the R-keras example:
https://tensorflow.rstudio.com/guide/keras/

There is a command 'predict_classes' that is now deprecated in keras.

--> if I knew how to insert images, I would put the screenshot of the error here <--

You should keep your help documentation reasonably current.

The way to get it to work is:
model %>% predict(x_test) %>% k_argmax()

@t-kalinowski t-kalinowski added the docs Improvements to documentation label Sep 28, 2021
@nicholasjhorton
Copy link

Here's what I observed in terms of the warning:

1: In keras::predict_classes(object = object$fit, x = as.matrix(new_data)) :
  `predict_classes()` is deprecated and and was removed from tensorflow in version 2.6.
Please update your code:
  * If your model does multi-class classification:
    (e.g. if it uses a `softmax` last-layer activation).

      model %>% predict(x) %>% k_argmax()

  * if your model does binary classification
    (e.g. if it uses a `sigmoid` last-layer activation).

      model %>% predict(x) %>% `>`(0.5) %>% k_cast("int32")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements to documentation
Projects
None yet
Development

No branches or pull requests

3 participants