Error Message: "lazy-load database 'keras.rdb' is corrupt"

To construct a reprex, I figured I better install keras. After installing keras, I can successfully call a tensorflow function, but not access anything in keras. The error says the lazy-load database is corrupt. Is that an obscure way to say my operating system (Ubuntu 14.04 LTS) is too old? Rumor has it that keras requires Ubuntu >= 16.04, though I haven't see that dependency stated explicitly, and it istalled without error.

Below are the last 3 expressions evaluated in my R session.

> install.packages("keras")
Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
trying URL 'https://cloud.r-project.org/src/contrib/keras_2.2.4.tar.gz'
Content type 'application/x-gzip' length 4960266 bytes (4.7 MB)
==================================================
downloaded 4.7 MB

* installing *source* package ‘keras’ ...
** package ‘keras’ successfully unpacked and MD5 sums checked
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
* DONE (keras)

The downloaded source packages are in
	‘/tmp/RtmpMZFe2K/downloaded_packages’
> tensorflow:::use_session_with_seed(1)
Set session seed to 1 (disabled GPU)
> keras:::callback_early_stopping
Error in runHook(".onLoad", env, package.lib, package) : 
  lazy-load database '/usr/local/lib/R/site-library/keras/R/keras.rdb' is corrupt
In addition: Warning message:
In runHook(".onLoad", env, package.lib, package) :
  internal error -3 in R_decompress1

In https://github.com/rstudio/keras/issues/298 I found a similar symptom, and there J.J. Allaire gave the fix, which also helped my case:

restarting your R session will clear the error

8 Likes

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.