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

layer_dense() error : ValueError #1414

Open
kyongryun opened this issue Mar 12, 2024 · 2 comments
Open

layer_dense() error : ValueError #1414

kyongryun opened this issue Mar 12, 2024 · 2 comments

Comments

@kyongryun
Copy link

Hello,

Would you like to help me fix this issue?

4. model creation

model <- keras_model_sequential()
model %>%
layer_dense(units = 2, activation = 'sigmoid', input_shape = c(3)) %>%
layer_dense(1, activation = "sigmoid")

Error message :
Error in py_call_impl(callable, call_args$unnamed, call_args$named) :
ValueError: Only input tensors may be passed as positional arguments. The following argument value should be passed as a keyword argument: (of type <class 'keras.src.models.sequential.Sequential'>)
Run reticulate::py_last_error() for details.

A following is the version of the packages.
tensorflow_2.15.0 keras_2.13.0

loaded via a namespace (and not attached):
[1] vctrs_0.6.5 cli_3.6.2 rlang_1.1.3 zeallot_0.1.0 forcats_1.0.0 png_0.1-8 generics_0.1.3
[8] jsonlite_1.8.8 glue_1.7.0 hms_1.1.3 fansi_1.0.5 grid_4.3.0 tfruns_1.5.2 tibble_3.2.1
[15] base64enc_0.1-3 lifecycle_1.0.4 whisker_0.4.1 compiler_4.3.0 Rcpp_1.0.12 pkgconfig_2.0.3 rstudioapi_0.15.0
[22] lattice_0.21-8 R6_2.5.1 reticulate_1.34.0 tidyselect_1.2.0 utf8_1.2.3 pillar_1.9.0 Matrix_1.5-4
[29] withr_3.0.0 tools_4.3.0

R version : R version 4.3.0

Thank you.

@t-kalinowski t-kalinowski transferred this issue from rstudio/tensorflow.rstudio.com Mar 13, 2024
@t-kalinowski
Copy link
Member

Hello, thanks for reporting.

I am unable to reproduce the error. I tried with both TF 2.13 and TF 2.15.

How did you install keras? Did you use keras::install_keras() or some other approach?

After reproducing the error, can you please post the output from:

reticulate::py_config()
sessioninfo::session_info()
reticulate::py_list_packages()

@kyongryun
Copy link
Author

kyongryun commented Mar 13, 2024 via email

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

2 participants