-
Notifications
You must be signed in to change notification settings - Fork 283
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
Comments
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 After reproducing the error, can you please post the output from: reticulate::py_config()
sessioninfo::session_info()
reticulate::py_list_packages() |
Hi Tomasz,
Thank you so much for your reply.
I can’t remember exactly. I might install Keras from CRAN.
My env. is
```
reticulate::py_config()
python: /home/dailee/.virtualenvs/r-reticulate/bin/python
libpython: /opt/python/3.10.9/lib/libpython3.10.so
pythonhome: /home/dailee/.virtualenvs/r-reticulate:/home/dailee/.virtualenvs/r-reticulate
version: 3.10.12 | packaged by conda-forge | (main, Jun 23 2023, 22:40:32) [GCC 12.3.0]
numpy: /home/dailee/.virtualenvs/r-reticulate/lib/python3.10/site-packages/numpy
numpy_version: 1.26.4
tensorflow: /home/dailee/.virtualenvs/r-reticulate/lib/python3.10/site-packages/tensorflow
NOTE: Python version was forced by VIRTUAL_ENV
reticulate::py_list_packages()
package version requirement
1 absl-py 2.1.0 absl-py==2.1.0
2 astunparse 1.6.3 astunparse==1.6.3
3 certifi 2024.2.2 certifi==2024.2.2
4 charset-normalizer 3.3.2 charset-normalizer==3.3.2
5 contourpy 1.2.0 contourpy==1.2.0
6 cycler 0.12.1 cycler==0.12.1
7 dm-tree 0.1.8 dm-tree==0.1.8
8 flatbuffers 24.3.7 flatbuffers==24.3.7
9 fonttools 4.49.0 fonttools==4.49.0
10 gast 0.5.4 gast==0.5.4
11 google-pasta 0.2.0 google-pasta==0.2.0
12 grpcio 1.62.1 grpcio==1.62.1
13 h5py 3.10.0 h5py==3.10.0
14 idna 3.6 idna==3.6
15 joblib 1.3.2 joblib==1.3.2
16 keras 3.0.5 keras==3.0.5
17 kiwisolver 1.4.5 kiwisolver==1.4.5
18 libclang 16.0.6 libclang==16.0.6
19 Markdown 3.5.2 Markdown==3.5.2
20 markdown-it-py 3.0.0 markdown-it-py==3.0.0
21 MarkupSafe 2.1.5 MarkupSafe==2.1.5
22 matplotlib 3.8.3 matplotlib==3.8.3
23 mdurl 0.1.2 mdurl==0.1.2
24 ml-dtypes 0.3.2 ml-dtypes==0.3.2
25 namex 0.0.7 namex==0.0.7
26 numpy 1.26.4 numpy==1.26.4
27 opt-einsum 3.3.0 opt-einsum==3.3.0
28 packaging 24.0 packaging==24.0
29 pandas 2.2.1 pandas==2.2.1
30 pillow 10.2.0 pillow==10.2.0
31 protobuf 4.25.3 protobuf==4.25.3
32 Pygments 2.17.2 Pygments==2.17.2
33 pyparsing 3.1.2 pyparsing==3.1.2
34 python-dateutil 2.9.0.post0 python-dateutil==2.9.0.post0
35 pytz 2024.1 pytz==2024.1
36 requests 2.31.0 requests==2.31.0
37 rich 13.7.1 rich==13.7.1
38 scikeras 0.12.0 scikeras==0.12.0
39 scikit-learn 1.4.1.post1 scikit-learn==1.4.1.post1
40 scipy 1.12.0 scipy==1.12.0
41 six 1.16.0 six==1.16.0
42 tensorboard 2.16.2 tensorboard==2.16.2
43 tensorboard-data-server 0.7.2 tensorboard-data-server==0.7.2
44 tensorflow 2.16.1 tensorflow==2.16.1
45 tensorflow-io-gcs-filesystem 0.36.0 tensorflow-io-gcs-filesystem==0.36.0
46 tensorrt 8.6.1.post1 tensorrt==8.6.1.post1
47 termcolor 2.4.0 termcolor==2.4.0
48 threadpoolctl 3.3.0 threadpoolctl==3.3.0
49 typing_extensions 4.10.0 typing_extensions==4.10.0
50 tzdata 2024.1 tzdata==2024.1
51 urllib3 2.2.1 urllib3==2.2.1
52 Werkzeug 3.0.1 Werkzeug==3.0.1
53 wrapt 1.16.0 wrapt==1.16.0
sessionInfo()
R version 4.3.0 (2023-04-21)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Red Hat Enterprise Linux 8.8 (Ootpa)
Matrix products: default
BLAS/LAPACK: /usr/lib64/libopenblasp-r0.3.15.so; LAPACK version 3.9.0
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 LC_MONETARY=en_US.UTF-8
[6] LC_MESSAGES=en_US.UTF-8 LC_PAPER=en_US.UTF-8 LC_NAME=C LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
time zone: America/Los_Angeles
tzcode source: system (glibc)
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] neuralnet_1.44.2 mlbench_2.1-3.1 haven_2.5.3 magrittr_2.0.3 dplyr_1.1.3 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
```
Thank you.
* Daisy
This email message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. If you are the intended recipient, please be advised that the content of this message is subject to access, review and disclosure by the sender's email system administrator
From: Tomasz Kalinowski ***@***.***>
Date: Wednesday, March 13, 2024 at 5:12 AM
To: rstudio/keras ***@***.***>
Cc: Daisy Lee ***@***.***>, Author ***@***.***>
Subject: Re: [rstudio/keras] layer_dense() error : ValueError (Issue #1414)
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()
—
Reply to this email directly, view it on GitHub<#1414 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/A7PW2UWGU6KCZDHSNZXWPYLYYA7BZAVCNFSM6AAAAABEUA2VGCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOJUGI2DCNZQGY>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The text was updated successfully, but these errors were encountered: