-
Notifications
You must be signed in to change notification settings - Fork 21
Description
Hi, thanks for putting this up, im using this code for my MD project. Everything working well until the moment where i try to create a behavior classifier. Seems like the function predict_classes() has been removed from tensorflow in v2.6. When trying to call the function ClassifyBehaviors it shows the error
AttributeError: 'Sequential' object has no attribute 'predict_classes'
and points what code to use instead. When I try to correct the code on my own the function looks like this
ClassifyBehaviors <- function(t,model, model_parameters){
if(!IsTrackingData(t)){
stop("Object is not of type TrackingData")
}
t <- CreateTestSet(t, model_parameters$integration_period)
t$labels$classifications <- model %>% predict(t$train_x) %>% k_argmax()``
###before "t$labels$classifications <- model %>% predict_classes(t$train_x)###
t$labels$classifications <- c(rep(NA,model_parameters$integration_period), model_parameters$Feature_names[t$labels$classifications + 1], rep(NA,model_parameters$integration_period))
return(t)
}
That way it allows it to pass that last error, but then it shows
Error in model_parameters$Feature_names[t$labels$classifications + 1] :
invalid subscript type 'environment'
``
I'm stuck in trying to correct this error, hope you can update the code so it works with TF v2.6+