[go: nahoru, domu]

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

使用tf2.4 保存pb报错 #3

Open
liuliuNLP opened this issue Feb 11, 2022 · 1 comment
Open

使用tf2.4 保存pb报错 #3

liuliuNLP opened this issue Feb 11, 2022 · 1 comment

Comments

@liuliuNLP
Copy link

加载预训练模型

model = build_transformer_model(
config_path=config_path,
checkpoint_path=checkpoint_path,
return_keras_model=False
)

output = GlobalPointer(len(categories), 64)(model.output)
model = keras.models.Model(model.input, output)
model.summary()

model.compile(
loss=global_pointer_crossentropy,
optimizer=Adam(learning_rate),
metrics=[global_pointer_f1_score]
)

evaluator = Evaluator()
train_generator = data_generator(train_data, batch_size)
model.fit(
train_generator.forfit(),
steps_per_epoch=len(train_generator),
epochs=epochs,
callbacks=[evaluator]
)
export_path = 'model'
version = "1"
model.save(export_path + version, save_format="tf")

AttributeError: 'Dropout' object has no attribute '_saved_model_inputs_spec'

@zhanghaok
Copy link

_saved_model_inputs_spec

这种大概率是包的版本问题可以升级一下包的版本

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

2 participants