Skip to content

Commit

Permalink
Merge pull request #1025 from OldLipe/feat/temp_seg
Browse files Browse the repository at this point in the history
Fix cuda clean cache bug
  • Loading branch information
gilbertocamara authored Oct 26, 2023
2 parents 49e4714 + 4b51716 commit 9f7d045
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
4 changes: 3 additions & 1 deletion R/api_classify.R
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@
# Apply the classification model to values
values <- ml_model(values)
# Clean the torch cache
torch::cuda_empty_cache()
if (torch::cuda_is_available()) {
torch::cuda_empty_cache()
}
# Are the results consistent with the data input?
.check_processed_values(values, input_pixels)
# Log
Expand Down
2 changes: 2 additions & 0 deletions R/sits_classify.R
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ sits_classify.sits <- function(data,
...,
filter_fn = NULL,
multicores = 2L,
gpu_memory = NULL,
progress = TRUE) {
# Pre-conditions
data <- .check_samples_ts(data)
Expand All @@ -181,6 +182,7 @@ sits_classify.sits <- function(data,
ml_model = ml_model,
filter_fn = filter_fn,
multicores = multicores,
gpu_memory = gpu_memory,
progress = progress
)
return(classified_ts)
Expand Down
5 changes: 3 additions & 2 deletions man/sits_classify.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9f7d045

Please sign in to comment.