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

Error in py_call_impl(callable, dots$args, dots$keywords) #3

Open
safalabolo opened this issue Mar 23, 2022 · 2 comments
Open

Error in py_call_impl(callable, dots$args, dots$keywords) #3

safalabolo opened this issue Mar 23, 2022 · 2 comments

Comments

@safalabolo
Copy link

safalabolo commented Mar 23, 2022

Hi Christian,
thank you for sharing this important material!

After performing all the steps related to installing the libraries, etc.

install.packages(c("keras","tfdatasets","mapview","stars","rsample","gdalUtils","purrr", "magick", "jpeg"))

reticulate::install_miniconda()
keras::install_keras()

reticulate::py_config()
tensorflow::tf_config()
keras::is_keras_available()

After downloading and unzipping the tutorial data, when I start the block including the Line 235 of the Tutorial_DL_UAV.Rmd file

I have the following error:

pretrained_unet <- load_model_hdf5("./pretrained_unet.h5")
Error in py_call_impl(callable, dots$args, dots$keywords) :
TypeError: Expected trainable argument to be a boolean, but got: None

Detailed traceback:
File "C:\Users\Utente\AppData\Local\R-MINI1\envs\R-RETI1\lib\site-packages\keras\utils\traceback_utils.py", line 67, in error_handler
raise e.with_traceback(filtered_tb) from None
File "C:\Users\Utente\AppData\Local\R-MINI1\envs\R-RETI1\lib\site-packages\keras\engine\base_layer.py", line 349, in init
raise TypeError(

Unfortunately I was unable to understand why.
Thanks in advance for the support.

@DaChro
Copy link
Owner

DaChro commented Mar 28, 2022

Hi safalabolo,
my first guess would be that this has something to do with a conflict between the tensorflow/keras versions used in the tutorial (and for creating this model you want to load) and your installed version. I was able to reproduce the error with tf 2.8 and could solve it by installing tf 2.2, which was also used in the tutorial. You can install a specific version by using tensorflow::install_tensorflow(version = "2.2.0") . However, it is probably a good idea to test that in a separate conda environment that you create beforehand (using conda_create() and naming it, e.g., "mytestenv"), then do tensorflow::install_tensorflow(envname = "mytestenv",version = "2.2.0")
Best,
Christian

@rion-saeon
Copy link

rion-saeon commented Jun 21, 2024

Hello @DaChro. I tried the workaround of this seemingly lovely R tutorial but to no avail.

See attached log.
issue_log_conda_tensorflow.txt

If you could please keep this workflow current it will be good as there are not many other such tutorials out there explaining such object detection/classification.

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

3 participants