biomodhub / biomod2

BIOMOD is a computer platform for ensemble forecasting of species distributions, enabling the treatment of a range of methodological uncertainties in models and the examination of species-environment relationships.
85 stars 22 forks source link

Error in BIOMOD_xxx - [Error in BIOMOD_EnsembleModeling "rgedRun_mergedAlgo.predictions', probable reason 'No such file or directory' " ] #425

Closed silveiratcl closed 7 months ago

silveiratcl commented 7 months ago

Hello folks,

Trying to run BIOMOD_EnsembleModeling() and got the folowing error message Any Idea? I'm seeking assistance to resolve this issue. Is this a known issue or does anyone have any insights on how to troubleshoot it?

Best regards,

Thiago

... -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Build Ensemble Models -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

! all models available will be included in ensemble.modeling ! Ensemble Models will be filtered and/or weighted using validation dataset (if possible). Please use metric.select.dataset for alternative options.

Evaluation & Weighting methods summary : TSS over 0.7

mergedData_mergedRun_mergedAlgo ensemble modeling Mean of probabilities by TSS ... Coef of variation of probabilities by TSS ... Median of probabilities by TSS ... Committee averaging by TSS ... original models scores = 0.8 1 1 final models weights = 0.286 0.357 0.357 Probabilities weighting mean by TSS ... Confidence Interval (Inf) by TSS ... Confidence Interval (Sup) by TSS ...Error in { : task 1 failed - "task 1 failed - "task 1 failed - "cannot open the connection""" In addition: Warning messages: 1: In gzfile(file, "wb") : cannot open compressed file './Tubastraea.coccinea/.BIOMOD_DATA/Tubastraea coccineaModel1/ensemble.models/ensemble.models.predictions/Tubastraea.coccinea_EMmeanByTSS_mergedData_mergedRun_mergedAlgo.predictions', probable reason 'No such file or directory' 2: In gzfile(file, "wb") : cannot open compressed file './Tubastraea.coccinea/.BIOMOD_DATA/Tubastraea coccineaModel1/ensemble.models/ensemble.models.predictions/Tubastraea.coccinea_EMcvByTSS_mergedData_mergedRun_mergedAlgo.predictions', probable reason 'No such file or directory' 3: In gzfile(file, "wb") : cannot open compressed file './Tubastraea.coccinea/.BIOMOD_DATA/Tubastraea coccineaModel1/ensemble.models/ensemble.models.predictions/Tubastraea.coccinea_EMmedianByTSS_mergedData_mergedRun_mergedAlgo.predictions', probable reason 'No such file or directory' 4: In gzfile(file, "wb") : cannot open compressed file './Tubastraea.coccinea/.BIOMOD_DATA/Tubastraea coccineaModel1/ensemble.models/ensemble.models.predictions/Tubastraea.coccinea_EMcaByTSS_mergedData_mergedRun_mergedAlgo.predictions', probable reason 'No such file or directory' 5: In gzfile(file, "wb") : cannot open compressed file './Tubastraea.coccinea/.BIOMOD_DATA/Tubastraea coccineaModel1/ensemble.models/ensemble.models.predictions/Tubastraea.coccinea_EMwmeanByTSS_mergedData_mergedRun_mergedAlgo.predictions', probable reason 'No such file or directory' 6: In gzfile(file, "wb") : cannot open compressed file './Tubastraea.coccinea/.BIOMOD_DATA/Tubastraea coccineaModel1/ensemble.models/ensemble.models.predictions/Tubastraea.coccinea_EMciInfByTSS_mergedData_mergedRun_mergedAlgo.predictions', probable reason 'No such file or directory' 7: In gzfile(file, "wb") : cannot open compressed file './Tubastraea.coccinea/.BIOMOD_DATA/Tubastraea coccineaModel1/ensemble.models/ensemble.models.predictions/Tubastraea.coccinea_EMciSupByTSS_mergedData_mergedRun_mergedAlgo.predictions', probable reason 'No such file or directory'

myBiomodData1 <- BIOMOD_FormatingData(resp.var = DataSpecies,
                                      expl.var = predictors1,
                                      resp.xy = myRespXY,
                                      resp.name = myRespName)

myBiomodOption <- BIOMOD_ModelingOptions()
myBiomodOption

myBiomodModelOut1 <- BIOMOD_Modeling(myBiomodData1,
                                     models = c('GLM','RF'), 
                                     bm.options = myBiomodOption,
                                     CV.strategy = 'random',
                                     CV.nb.rep = 5,
                                     CV.perc = 0.7,
                                     var.import=3,
                                     metric.eval = c('ROC', 'TSS'),
                                     scale.models = TRUE,
                                     modeling.id = paste(myRespName,"Model1",sep=""))

myBiomodModelOut1

myBiomodEM <- BIOMOD_EnsembleModeling(bm.mod = myBiomodModelOut1,
                                      models.chosen = 'all',
                                      em.by = 'all',
                                      em.algo = c('EMmean', 'EMcv', 'EMci', 'EMmedian', 'EMca', 'EMwmean'),
                                      metric.select = c('TSS'),
                                      metric.select.thresh = c(0.7),
                                      metric.eval = c('TSS','ROC'),
                                      var.import = 3,
                                      EMci.alpha = 0.05,
                                      EMwmean.decay = 'proportional')
# sessionInfo() 

R version 4.2.3 (2023-03-15 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 22621)

Matrix products: default

locale:
[1] LC_COLLATE=Portuguese_Brazil.utf8  LC_CTYPE=Portuguese_Brazil.utf8    LC_MONETARY=Portuguese_Brazil.utf8
[4] LC_NUMERIC=C                       LC_TIME=Portuguese_Brazil.utf8    

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

other attached packages:
 [1] ggtext_0.1.2    tidyterra_0.5.2 dismo_1.3-14    dplyr_1.1.1     biomod2_4.2-4   mgcv_1.9-1      nlme_3.1-162    psych_2.4.1    
 [9] car_3.1-2       carData_3.0-5   gtools_3.9.5    terra_1.7-71    sf_1.0-15       raster_3.6-26   sp_2.1-3       

loaded via a namespace (and not attached):
 [1] tidyr_1.3.0            viridisLite_0.4.2      jsonlite_1.8.4         splines_4.2.3          foreach_1.5.2          Formula_1.2-5         
 [7] pillar_1.9.0           lattice_0.20-45        glue_1.6.2             pROC_1.18.4            gridtext_0.1.5         randomForest_4.7-1.1  
[13] colorspace_2.0-3       gbm_2.1.8.1            Matrix_1.5-3           plyr_1.8.8             pkgconfig_2.0.3        maxnet_0.1.4          
[19] PresenceAbsence_1.1.11 earth_5.3.2            purrr_1.0.1            scales_1.2.1           TeachingDemos_2.12     tibble_3.2.1          
[25] proxy_0.4-27           mda_0.5-4              farver_2.1.1           generics_0.1.3         ggplot2_3.4.3          xgboost_1.7.5.1       
[31] withr_2.5.0            nnet_7.3-18            cli_3.6.1              mnormt_2.1.1           survival_3.5-3         magrittr_2.0.3        
[37] fansi_1.0.3            MASS_7.3-58.2          xml2_1.3.3             class_7.3-21           tools_4.2.3            data.table_1.14.2     
[43] lifecycle_1.0.3        stringr_1.5.0          munsell_0.5.0          plotrix_3.8-2          compiler_4.2.3         e1071_1.7-13          
[49] rlang_1.1.0            plotmo_3.6.2           classInt_0.4-9         units_0.8-1            grid_4.2.3             iterators_1.0.14      
[55] rstudioapi_0.14        labeling_0.4.2         gtable_0.3.3           codetools_0.2-19       abind_1.4-5            DBI_1.1.3             
[61] reshape_0.8.9          reshape2_1.4.4         R6_2.5.1               utf8_1.2.2             KernSmooth_2.23-20     stringi_1.7.6         
[67] parallel_4.2.3         Rcpp_1.0.11            vctrs_0.6.1            rpart_4.1.19           tidyselect_1.2.
HeleneBlt commented 7 months ago

Hello Thiago

On Windows, you may have an issue with path length, in which case I suggest moving your folder higher in the folder hierarchy to have a shorter path. You can also have a look at the issue #412 where Joost finds another solution. Tell me if this does the trick !

Hélène

silveiratcl commented 7 months ago

Hello Helene!

It worked! Thanks!