ios – AttributeError: The "sequential object" does not have the attribute "rfind & # 39;


I'm trying to convert my model using coremltools with the version details below

Python - 2.7
keras - 2.1.6
Tensorflow - 1.9

and other related addictions ..

Get an error below when running the code to convert

sepIndex = p.rfind (sep)
AttributeError: The "sequential object" does not have the attribute "rfind & # 39;

import numpy as np
bone import
from keras.models import model_from_json
import coremltools
path = os.getcwd ()
#path = input ("Enter the saved template path->")
# path = path.strip ()


# Load weights and models
json_file = open (os.path.join (path, LMN.json), & rt; r & # 39;)
model_json = json_file.read ()

model = model_from_json (model_json)
model.load_weights (os.path.join (path, LMN.h5))
# model.compile (optimizer = adam, loss = binary_crossentropy, metrics =['accuracy'])

# convert the template to Core ML
coreml_model = coremltools.converters.keras.convert (template, input_name = "input", output_name = "output")

# define the general metadata of the model
coreml_model.author = & # 39; ABC & # 39;
coreml_model.license = & # 39; XYZ & # 39;
coreml_model.short_description = & # 39; some details & # 39;

# define the model input information
coreml_model.input_description['input'] = & # 39; some details & # 39;

# define the output information of the model
coreml_model.output_description['output'] = & # 39; some details & # 39;

f_name, f_ext = os.path.splitext (template)
coreml_model.save (os.path.join (path, f_name + & # 39; .mlmodel & # 39;))

I went through git and found problems like this but I tried and I am unable to fix it. Need specific help.