-
Notifications
You must be signed in to change notification settings - Fork 282
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
compile function does not work #1448
Comments
I believe this was fixed with the last release of keras. Can you please run update.packages()? Does the issue go away? |
#install packages for deep learning model Define input shape for timesteps and featuresinput_shape <- c(timesteps, features) Create the input layerinputs <- layer_input(shape = input_shape) Define input shapetimesteps <- 10 # Replace with your actual timestep value Define the model sequencemodel <- keras_model_sequential() Compile the model (assuming you have defined loss and optimizer functions)model %>% compile(loss = loss_function, optimizer = optimizer) thank you so much for answer my codes create problem :> model <- keras_model(
|
Thank you for helping, I got solution based on your recommendation. |
I have tried building keras model and then I got this problem which I cannot solve. Can you provide solution about this problem?
model <- compile(model, loss = loss, optimizer = optimizer, metrics = metrics)
Error in UseMethod("compile") :
no applicable method for 'compile' applied to an object of class "c('keras.src.models.sequential.Sequential', 'keras.models.sequential.Sequential', 'keras.src.models.model.Model', 'keras.models.model.Model', 'keras.src.backend.tensorflow.trainer.TensorFlowTrainer', 'keras.backend.tensorflow.trainer.TensorFlowTrainer', 'keras.src.trainers.trainer.Trainer', 'keras.trainers.trainer.Trainer', 'keras.src.layers.layer.Layer', 'keras.layers.layer.Layer', 'keras.src.backend.tensorflow.layer.TFLayer', 'keras.backend.tensorflow.layer.TFLayer', 'keras.src.backend.tensorflow.trackable.KerasAutoTrackable', 'keras.backend.tensorflow.trackable.KerasAutoTrackable', 'tensorflow.python.trackable.autotrackable.AutoTrackable', 'tensorflow.python.trackable.base.Trackable', 'keras.src.ops.operation.Operation', 'keras.ops.operation.Operation', 'keras.src.saving.keras_saveable.KerasSaveable', 'keras.saving.keras_saveable.KerasSaveable', 'python.builtin.object')"
The text was updated successfully, but these errors were encountered: