rstudio / tensorflow

TensorFlow for R
https://tensorflow.rstudio.com
Apache License 2.0
1.32k stars 317 forks source link

W tensorflow/tsl/platform/profile_utils/cpu_utils.cc:128] Failed to get CPU frequency: 0 Hz Error in unserialize(node$con) : error reading from connection #568

Closed denvercal1234GitHub closed 1 year ago

denvercal1234GitHub commented 1 year ago

Hi there,

I followed #530 (to install tensor flow and keras on my Mac m1) and encountered the error below when running it.

Would you mind helping me to diagnose this error?

Thank you for your help.

> tensorflow::as_tensor("Hello World")
Metal device set to: Apple M1 Max

systemMemory: 64.00 GB
maxCacheSize: 24.00 GB

tf.Tensor(b'Hello World', shape=(), dtype=string)
> tensorflow::as_tensor("Hello World")
tf.Tensor(b'Hello World', shape=(), dtype=string)
> reticulate::py_config()
python:         /Users/stillhere/Library/r-miniconda-arm64/envs/r-reticulate/bin/python
libpython:      /Users/stillhere/Library/r-miniconda-arm64/envs/r-reticulate/lib/libpython3.8.dylib
pythonhome:     /Users/stillhere/Library/r-miniconda-arm64/envs/r-reticulate:/Users/stillhere/Library/r-miniconda-arm64/envs/r-reticulate
version:        3.8.16 | packaged by conda-forge | (default, Feb  1 2023, 16:01:13)  [Clang 14.0.6 ]
numpy:          /Users/stillhere/Library/r-miniconda-arm64/envs/r-reticulate/lib/python3.8/site-packages/numpy
numpy_version:  1.23.2
> tensorflow::tf_config()
TensorFlow v2.12.0 ()
Python v3.8 (~/Library/r-miniconda-arm64/envs/r-reticulate/bin/python)
> reticulate::import("tensorflow")
Module(tensorflow)
> reticulate::py_last_error()
NULL
> sessionInfo()
R version 4.2.3 (2023-03-15)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS Ventura 13.3.1

Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/lib/libRlapack.dylib

Random number generation:
 RNG:     L'Ecuyer-CMRG 
 Normal:  Inversion 
 Sample:  Rejection 

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] grid      stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] gridExtra_2.3         ggcyto_1.26.4         ncdfFlow_2.44.0       BH_1.81.0-1          
 [5] flowClust_3.36.1      ggplot2_3.4.2         vegan_2.6-4           permute_0.9-7        
 [9] Spectre_1.0.0         flowVS_1.30.0         flowStats_4.10.0      flowViz_1.62.0       
[13] lattice_0.21-8        flowSpecs_1.12.0      CytoML_2.10.0         flowWorkspace_4.10.1 
[17] scico_1.3.1           CytobankAPI_2.2.0     httr_1.4.5            curl_5.0.0           
[21] cytotidyr_0.0.1.100   kableExtra_1.3.4.9000 PeacoQC_1.9.3         infinityFlow_1.8.0   
[25] flowCore_2.10.0      

loaded via a namespace (and not attached):
  [1] utf8_1.2.3             reticulate_1.28-9000   ks_1.14.0             
  [4] tidyselect_1.2.0       htmlwidgets_1.6.2      BiocParallel_1.32.6   
  [7] rainbow_3.7            devtools_2.4.5         munsell_0.5.0         
 [10] codetools_0.2-19       xgboost_1.7.5.1        interp_1.1-4          
 [13] miniUI_0.1.1.1         withr_2.5.0            keras_2.11.1          
 [16] colorspace_2.1-0       Biobase_2.58.0         knitr_1.42            
 [19] rstudioapi_0.14        stats4_4.2.3           tensorflow_2.11.0.9000
 [22] robustbase_0.95-1      openCyto_2.10.1        mnormt_2.1.1          
 [25] rprojroot_2.0.3        vctrs_0.6.2            generics_0.1.3        
 [28] xfun_0.38              R6_2.5.1               doParallel_1.0.17     
 [31] clue_0.3-64            bitops_1.0-7           cachem_1.0.7          
 [34] promises_1.2.0.1       scales_1.2.1           gtable_0.3.3          
 [37] processx_3.8.1         RProtoBufLib_2.10.0    rlang_1.1.0           
 [40] zeallot_0.1.0          systemfonts_1.0.4      GlobalOptions_0.1.2   
 [43] splines_4.2.3          hexbin_1.28.3          yaml_2.3.7            
 [46] BiocManager_1.30.20    reshape2_1.4.4         httpuv_1.6.9          
 [49] IDPmisc_1.1.20         RBGL_1.74.0            tools_4.2.3           
 [52] usethis_2.1.6          ellipsis_0.3.2         raster_3.6-20         
 [55] RColorBrewer_1.1-3     proxy_0.4-27           BiocGenerics_0.44.0   
 [58] sessioninfo_1.2.2      Rcpp_1.0.10            plyr_1.8.8            
 [61] base64enc_0.1-3        zlibbioc_1.44.0        purrr_1.0.1           
 [64] RCurl_1.98-1.12        ps_1.7.5               prettyunits_1.1.1     
 [67] deldir_1.0-6           pbapply_1.7-0          GetoptLong_1.0.5      
 [70] urlchecker_1.0.1       S4Vectors_0.36.2       deSolve_1.35          
 [73] zoo_1.8-12             cluster_2.1.4          fs_1.6.1              
 [76] here_1.0.1             fda_6.0.5              magrittr_2.0.3        
 [79] data.table_1.14.8      hdrcde_3.4             circlize_0.4.15       
 [82] mvtnorm_1.1-3          whisker_0.4.1          matrixStats_0.63.0    
 [85] pkgload_1.3.2          mime_0.12              evaluate_0.20         
 [88] xtable_1.8-4           XML_3.99-0.14          jpeg_0.1-10           
 [91] mclust_6.0.0           IRanges_2.32.0         shape_1.4.6           
 [94] tfruns_1.5.1           compiler_4.2.3         tibble_3.2.1          
 [97] KernSmooth_2.23-20     crayon_1.5.2           fds_1.8               
[100] htmltools_0.5.5        mgcv_1.8-42            corpcor_1.6.10        
[103] pcaPP_2.0-3            later_1.3.0            tidyr_1.3.0           
[106] rrcov_1.7-2            DBI_1.1.3              matlab_1.0.4          
[109] ComplexHeatmap_2.14.0  MASS_7.3-58.3          Matrix_1.5-4          
[112] cli_3.6.1              parallel_4.2.3         pkgconfig_2.0.3       
[115] sp_1.6-0               terra_1.7-23           xml2_1.3.3            
[118] foreach_1.5.2          svglite_2.1.1          webshot_0.5.4         
[121] rvest_1.0.3            stringr_1.5.0          callr_3.7.3           
[124] digest_0.6.31          pracma_2.4.2           graph_1.76.0          
[127] rmarkdown_2.21         shiny_1.7.4            rjson_0.2.21          
[130] nlme_3.1-162           lifecycle_1.0.3        jsonlite_1.8.4        
[133] viridisLite_0.4.1      fansi_1.0.4            pillar_1.9.0          
[136] fastmap_1.1.1          DEoptimR_1.0-12        pkgbuild_1.4.0        
[139] glue_1.6.2             remotes_2.4.2          png_0.1-8             
[142] iterators_1.0.14       Rgraphviz_2.42.0       class_7.3-21          
[145] stringi_1.7.12         profvis_0.3.7          latticeExtra_0.6-30   
[148] memoise_2.0.1          dplyr_1.1.1            cytolib_2.10.1        
[151] e1071_1.7-13          
t-kalinowski commented 1 year ago

The W prefix indicates its only a warning (and error would have an E prefix). You can safely ignore the warning, it's a macOS specific issue and has no impact on how TensorFlow runs.

denvercal1234GitHub commented 1 year ago

Thank you @t-kalinowski for your response! That is useful to know. However, the process still stopped running after that warning. Does “error from reading connection” cause this?

t-kalinowski commented 1 year ago

It seems unrelated. Please feel free to open a new issue with more detail and instructions for how I can reproduce the error locally.