I am using keras in R for a classification problem.
I used  model <- keras_model_sequential() with 3 layers
parallel.model <- multi_gpu_model(model, gpus=2)
parallel.model %>% compile(
  loss = loss_binary_crossentropy,
  optimizer = optimizer_adam(lr = 0.001, epsilon = 1e-08),
  metrics = c("accuracy"))
parallel.model %>% fit(
  train.x,
  y.train,
  epochs = 50,
  batch_size = 256,
  validation_split = 0.2)
When I used
 y.test.hat <- parallel.model %>% predict_classes(test.y)
I got this error:
Error in py_get_attr_impl(x, name, silent) : 
  AttributeError: 'Model' object has no attribute 'predict_classes'
Calls: %>% ... py_get_attr_or_item -> py_get_attr -> py_get_attr_impl
Is it because parallel.model is not sequential? Because I got the same error when I used:
 parallel.model %>% pop_layer()