Skip to content
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

模型无法调用,求助 #105

Open
xinyidaren opened this issue Mar 16, 2020 · 0 comments
Open

模型无法调用,求助 #105

xinyidaren opened this issue Mar 16, 2020 · 0 comments

Comments

@xinyidaren
Copy link

模型生成代码(tensorflow2.0):
input_image = tf.keras.layers.Input(shape=[128, 128, 3], name="input_image")
center = layers.Conv2D(8,(3,3),padding='same',activation=tf.nn.relu6)(input_image)
center = layers.MaxPooling2D(pool_size=[2,2],strides=[2,2],padding='SAME')(center)
center = layers.Conv2D(8,(3,3),padding='same',activation=tf.nn.relu6)(center)
center = layers.MaxPooling2D(pool_size=[2,2],strides=[2,2],padding='SAME')(center)
center = layers.Conv2D(8,(3,3),padding='same',activation=tf.nn.relu6)(center)
center = layers.MaxPooling2D(pool_size=[2,2],strides=[2,2],padding='SAME')(center)
center = layers.Conv2D(8,(3,3),padding='same',activation=tf.nn.relu6)(center)
center = layers.MaxPooling2D(pool_size=[2,2],strides=[2,2],padding='SAME')(center)
center = layers.Flatten()(center)
center = layers.Dense(16, activation='relu')(center)
center = layers.Dense(10, activation='softmax')(center)
model = Model(inputs=[input_image], outputs=[center])

model.summary() #一个很简单的tensorflow2.0模型

model.save('mnist_cnn.h5')

converter = tf.lite.TFLiteConverter.from_keras_model(model)
tflite_model = converter.convert()
if not os.path.exists('./tflite_models'):
os.mkdir('./tflite_models')
with open('./tflite_models/keras.tflite', 'wb') as f:
f.write(tflite_model)

ncc转换版本为NNCase v0.2.0 Beta2

转换完的kmodel模型在程序调用时报错:

core dump: fault load
Cause 0x0000000000000005,EPC 0x00000000000008001b3b4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant