r-lib / pkgbuild

Find tools needed to build R packages
https://pkgbuild.r-lib.org
Other
66 stars 35 forks source link

Cannot install the torchvision package, using https://blogs.rstudio.com/ai/posts/2020-09-29-introducing-torch-for-r/ #168

Closed lgawarec closed 1 year ago

lgawarec commented 1 year ago

I get the same error every time when I try to install torchvision. I tried Yes and No for the pop-up question on using sources. I first did the following:

install.packages("torch") install.packages("devtools") devtools::install_github("mlverse/torch") library(torch)

This command failed to execute torch_tensor(1, device = "cuda")

Error in torch_tensor_cpp(data, dtype, device, requires_grad, pin_memory) : PyTorch is not linked with support for cuda devices Exception raised from getDeviceGuardImpl at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\c10/core/impl/DeviceGuardImplInterface.h:319 (most recent call first): 00007FFF3E8FAD1200007FFF3E8FACB0 c10.dll!c10::Error::Error [ @ ] 00007FFF3E8FA79E00007FFF3E8FA750 c10.dll!c10::detail::torchCheckFail [ @ ] 00007FFEC811EC0500007FFEC811EA60 torch_cpu.dll!at::Context::getDeviceFromPtr [ @ ] 00007FFEC85F0A4600007FFEC85F09B0 torch_cpu.dll!at::native::to [ @ ] 00007FFEC92DA96800007FFEC92D4610 torch_cpu.dll!at::compositeimplicitautograd::where [ @ ] 00007FFEC92C40ED00007FFEC928FAC0 torch_cpu.dll!at::compositeimplicitautograd::broadcast_to [ @ ] 00007FFEC8AF510F00007FFEC8AF4EE0 torch_cpu.dll!at::_ops::to_dtype_layout

Here is my session for installing torchvision, please help, many thanks!

R version 4.1.3 (2022-03-10) -- "One Push-Up" Copyright (C) 2022 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R.

Warning: namespace ‘caret’ is not available and has been replaced by .GlobalEnv when processing object ‘ctrl’ [Workspace loaded from ~/.RData]

Loading required package: ROCR

devtools::install_github("mlverse/torchvision") Downloading GitHub repo mlverse/torchvision@HEAD These packages have more recent versions available. It is recommended to update all of them. Which would you like to update?

1: All
2: CRAN packages only
3: None
4: cli (3.6.0 -> 3.6.1 ) [CRAN] 5: rlang (1.0.6 -> 1.1.1 ) [CRAN] 6: Rcpp (1.0.8.3 -> 1.0.10) [CRAN]

Enter one or more numbers, or an empty line to skip updates: 1 cli (3.6.0 -> 3.6.1 ) [CRAN] rlang (1.0.6 -> 1.1.1 ) [CRAN] Rcpp (1.0.8.3 -> 1.0.10) [CRAN] Installing 3 packages: cli, rlang, Rcpp

There is a binary version available but the source version is later: binary source needs_compilation rlang 1.1.0 1.1.1 TRUE

trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.1/cli_3.6.1.zip' Content type 'application/zip' length 1388241 bytes (1.3 MB) downloaded 1.3 MB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.1/rlang_1.1.0.zip' Content type 'application/zip' length 1710397 bytes (1.6 MB) downloaded 1.6 MB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.1/Rcpp_1.0.10.zip' Content type 'application/zip' length 3291415 bytes (3.1 MB) downloaded 3.1 MB

package ‘cli’ successfully unpacked and MD5 sums checked Warning: cannot remove prior installation of package ‘cli’ Warning: restored ‘cli’ package ‘rlang’ successfully unpacked and MD5 sums checked Warning: cannot remove prior installation of package ‘rlang’ Warning: restored ‘rlang’ package ‘Rcpp’ successfully unpacked and MD5 sums checked Warning: cannot remove prior installation of package ‘Rcpp’ Warning: restored ‘Rcpp’

The downloaded binary packages are in C:\Users\lgawarec\AppData\Local\Temp\Rtmp8gy3Lz\downloaded_packages -- R CMD build ------------------------------------------------------------- v checking for file 'C:\Users\lgawarec\AppData\Local\Temp\Rtmp8gy3Lz\remotes2bc831b0207a\mlverse-torchvision-2d8b936/DESCRIPTION' ...

1: All
2: CRAN packages only
3: None
4: cli (3.6.0 -> 3.6.1 ) [CRAN] 5: rlang (1.0.6 -> 1.1.1 ) [CRAN] 6: Rcpp (1.0.8.3 -> 1.0.10) [CRAN]

Enter one or more numbers, or an empty line to skip updates: 1 cli (3.6.0 -> 3.6.1 ) [CRAN] rlang (1.0.6 -> 1.1.1 ) [CRAN] Rcpp (1.0.8.3 -> 1.0.10) [CRAN] Installing 3 packages: cli, rlang, Rcpp

There is a binary version available but the source version is later: binary source needs_compilation rlang 1.1.0 1.1.1 TRUE

trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.1/cli_3.6.1.zip' Content type 'application/zip' length 1388241 bytes (1.3 MB) downloaded 1.3 MB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.1/Rcpp_1.0.10.zip' Content type 'application/zip' length 3291415 bytes (3.1 MB) downloaded 3.1 MB

package ‘cli’ successfully unpacked and MD5 sums checked Warning: cannot remove prior installation of package ‘cli’ Warning: restored ‘cli’ package ‘Rcpp’ successfully unpacked and MD5 sums checked Warning: cannot remove prior installation of package ‘Rcpp’ Warning: restored ‘Rcpp’

The downloaded binary packages are in C:\Users\lgawarec\AppData\Local\Temp\Rtmp8gy3Lz\downloaded_packages installing the source package ‘rlang’

trying URL 'https://cran.rstudio.com/src/contrib/rlang_1.1.1.tar.gz' Content type 'application/x-gzip' length 762533 bytes (744 KB) downloaded 744 KB

The downloaded source packages are in ‘C:\Users\lgawarec\AppData\Local\Temp\Rtmp8gy3Lz\downloaded_packages’ -- R CMD build ------------------------------------------------------------- v checking for file 'C:\Users\lgawarec\AppData\Local\Temp\Rtmp8gy3Lz\remotes2bc85107772b\mlverse-torchvision-2d8b936/DESCRIPTION' ...

installing the source package ‘torchvision’

trying URL 'https://cran.rstudio.com/src/contrib/torchvision_0.5.1.tar.gz' Content type 'application/x-gzip' length 2009611 bytes (1.9 MB) downloaded 1.9 MB

The downloaded source packages are in ‘C:\Users\lgawarec\AppData\Local\Temp\Rtmp8gy3Lz\downloaded_packages’

gaborcsardi commented 1 year ago

Why do you think that this error is related to the pkgbuild package?

lgawarec commented 1 year ago

Honestly, I didn't know where to post this question. I am sorry. I will try to take it off.

On Sat, Jun 24, 2023, 1:07 PM Gábor Csárdi @.***> wrote:

Why do you think that this error is related to the pkgbuild package?

— Reply to this email directly, view it on GitHub https://github.com/r-lib/pkgbuild/issues/168#issuecomment-1605653918, or unsubscribe https://github.com/notifications/unsubscribe-auth/APCFQYNIB4DUI5CFVIDIGHLXM4NETANCNFSM6AAAAAAZSTMDAQ . You are receiving this because you authored the thread.Message ID: @.***>

gaborcsardi commented 1 year ago

This is the issue tracker of torchvision: https://github.com/mlverse/torchvision/issues

lgawarec commented 1 year ago

Thank you very much.

On Sat, Jun 24, 2023, 2:14 PM Gábor Csárdi @.***> wrote:

This is the issue tracker of torchvision: https://github.com/mlverse/torchvision/issues

— Reply to this email directly, view it on GitHub https://github.com/r-lib/pkgbuild/issues/168#issuecomment-1605675262, or unsubscribe https://github.com/notifications/unsubscribe-auth/APCFQYN4VTETSG5YJEAZUELXM4U7LANCNFSM6AAAAAAZSTMDAQ . You are receiving this because you modified the open/close state.Message ID: @.***>