The app runs and works locally and utilizes a torch based NN, but when deployed via shiny won't predict and just disconnects from the server owing to an error message: Warning: Error in : Lantern is not loaded. Please use install_torch() to install additional dependencies. I did see this earlier post(Problem with LibLantern library during rsconnect deployment of R torch-based app.) but trying this:
Additional software needs to be downloaded and installed for torch to work correctly.
trying URL 'https://storage.googleapis.com/torch-lantern-builds/binaries/refs/heads/cran/v0.11.0/latest/lantern-0.11.0+cpu+x86_64-Linux.zip'
downloaded 5.4 MB
Warning: torch failed to start, restart your R session to try again.
You might need to reinstall torch using install_torch()
/srv/connect/apps/appname/libtorch/lib/liblantern.so -
/srv/connect/apps/appname/libtorch/lib/libtorch_cpu.so: cannot read file data
Caused by error in cpp_lantern_init():
! /srv/connect/apps/appname/libtorch/lib/liblantern.so - /srv/connect/apps/appname/libtorch/lib/libtorch_cpu.so: cannot read file data
You have to make sure that the directory pointed by TORCH_HOME is both writeable and readable when the app is launched, and that it's allowed to download files. Depending on the server configuration this directory might not be writable, can you try installing the additional deps into the app directory with something like: