install_torch() unable to download lantern from a link
install_torch(reinstall = T) trying URL 'https://github.com/mlverse/libtorch-mac-m1/releases/download/LibTorch-for-R/libtorch-arm64-v2.5.1.zip' Content type 'application/octet-stream' length 54413594 bytes (51.9 MB)
downloaded 51.9 MB
trying URL 'https://torch-cdn.mlverse.org/binaries/refs/heads/cran/v0.15.0/latest/lantern-0.15.1+cpu+arm64-Darwin.zip'
Error in value[[3L]]():
! Unable to download from https://torch-cdn.mlverse.org/binaries/refs/heads/cran/v0.15.0/latest/lantern-0.15.1+cpu+arm64-Darwin.zip
Run rlang::last_trace() to see where the error occurred.
Hi @kuiyuanshao,
I faced the exact same issue recetly while running install_torch() during CRAN check (R CMD check) in an isolated environment, typically used for package testing. The error occured because the lantern binary couldn't be downloaded from the default CDN URL. This seems to be a common problem in sandboxed environments where cached downloads aren't available.
Here is a simple fix that may work for you:
torch::install_torch(version = "0.12.0", reinstall = TRUE)
Hope this helps.
It doesn't work for me, calling "version = "0.12.0" still ends up in grabbing the 0.15.0 lantern.
This problem is still prohibiting the installation, could you help? @dfalbel https://torch-cdn.mlverse.org/binaries/refs/heads/cran/v0.15.1/latest/lantern-0.15.1+cu128-win64.zip returns error 403 access denied.
That's because cuda12.8 is not a supported version for torch v0.15.1. I'm preparing a submission for v0.16.0 that will support cuda 12.8. You can still install torch for older cuda versions, like 12.6 and 12.4.