t-kalinowski / deep-learning-with-R-2nd-edition-code

Code from the book "Deep Learning with R, 2nd Edition"
https://blogs.rstudio.com/ai/posts/2022-05-31-deep-learning-with-r-2e/
41 stars 18 forks source link

Build() method with more than one argument #17

Open yuriy-babenko opened 1 month ago

yuriy-babenko commented 1 month ago

https://github.com/t-kalinowski/deep-learning-with-R-2nd-edition-code/blob/5d666f93d52446511a8a8e4eb739eba1c0ffd199/ch03.R#L314

Error message:

Error in py_call_impl(callable, call_args$unnamed, call_args$named) : ValueError: For a build() method with more than one argument, all arguments should have a _shape suffix and match an argument from call(). E.g. build(self, foo_shape, bar_shape) For layer 'SimpleDense', Received build() argument self, which does not end in _shape.

t-kalinowski commented 1 month ago

Thanks for opening. I'm unable to reproduce the error.

How did you install keras / keras3?

I suggest using keras 3 if you can.

install.packages("keras3") # the current CRAN release
reticulate::install_python("3.11")
keras3::install_keras() 
yuriy-babenko commented 1 month ago

Thanks Tomasz. The suggested solution fixed the issue. I have been following the book and faced this, did not see anything in the errata https://manning-content.s3.amazonaws.com/download/5/66c07d5-197a-4c87-b038-ef28dff7647b/Allaire2_Errata.html but then discovered as well that the current way is using "keras3". Thanks!