尝试在 R 中安装火炬包时出错

问题描述 投票:0回答:0

我尝试在

torch
中安装
R
包以构建一些机器学习模型,但导致以下错误:

> install.packages("torch")
Installing package into ‘/home/saidm/R/x86_64-pc-linux-gnu-library/4.2’
(as ‘lib’ is unspecified)
trying URL 'https://cloud.r-project.org/src/contrib/torch_0.9.1.tar.gz'
Content type 'application/x-gzip' length 1609032 bytes (1.5 MB)
==================================================
downloaded 1.5 MB

* installing *source* package ‘torch’ ...
** package ‘torch’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
Renaming init
"/usr/lib/R/bin/Rscript" "../tools/renameinit.R"
Rscript execution error: No such file or directory
make: *** [Makevars:8: rename_init] Error 255
ERROR: compilation failed for package ‘torch’
* removing ‘/home/saidm/R/x86_64-pc-linux-gnu-library/4.2/torch’
Warning in install.packages :
  installation of package ‘torch’ had non-zero exit status

The downloaded source packages are in
    ‘/tmp/Rtmp45QtUs/downloaded_packages’

我再次尝试使用包

remotes
但它仍然给了我同样的错误:

> remotes::install_github("mlverse/torch")
Downloading GitHub repo mlverse/torch@HEAD
── R CMD build ────────────────────────────────────────────────────────────────────────────────────────────────
✔  checking for file ‘/tmp/Rtmp45QtUs/build-b904c9e30/torch/DESCRIPTION’ ...
─  preparing ‘torch’:
✔  checking DESCRIPTION meta-information ...
─  cleaning src
─  installing the package to process help pages (447ms)
         -----------------------------------
─  installing *source* package ‘torch’ ...
   ** using staged installation
   ** libs
   *** Skip building lantern.
   *** Renaming init
   "/usr/lib/R/bin/Rscript" "../tools/renameinit.R"
   Rscript execution error: No such file or directory
   make: *** [Makevars:21: rename_init] Error 255
   ERROR: compilation failed for package ‘torch’
─  removing ‘/tmp/RtmpoGaz4F/Rinst1fb117ee0c7e/torch’
         -----------------------------------
   ERROR: package installation failed
Error: Failed to install 'torch' from GitHub:
  ! System command 'R' failed

有谁知道如何解决这个问题,或者至少告诉我

Error 255
是什么意思?非常感谢您。

r installation torch
© www.soinside.com 2019 - 2024. All rights reserved.