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

Experiencing problem with textmodel_mlp #2389

Open
yeokcmark opened this issue May 14, 2024 · 0 comments
Open

Experiencing problem with textmodel_mlp #2389

yeokcmark opened this issue May 14, 2024 · 0 comments

Comments

@yeokcmark
Copy link

Describe the bug

Its my first time reporting an issue. Please forgive me if I'm doing it iincorrectly.

Reproducible code

tmod_rec1_mlp <-
textmodel_mlp(x = dfmat_rec1_train,
y = dfmat_rec1_train$target,
epochs = 20,
metrics = "categorical_accuracy",
verbose = TRUE)

predicted_class_rec1_mlp <-
predict(tmod_rec1_mlp,
dfmat_rec1_matched,
force = TRUE)

I am having problems with the predict() portion. This is the error message I get, I think its a tensorflow issue. But I dont know how to correct my code. Pls help if you have time

Error in py_get_attr_impl(x, name, silent) :
AttributeError: 'Sequential' object has no attribute 'predict_classes'
Run reticulate::py_last_error() for details.
In addition: Warning message:
In predict_classes(object$seqfitted, x = 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
None yet
Projects
None yet
Development

No branches or pull requests

1 participant