Skip to content
This repository has been archived by the owner on Jun 18, 2024. It is now read-only.

Error creating and exporting TFLite after fine-tuning (using run_squad_v1.py/run_squad_v2.py) #227

Open
manojpreveen opened this issue Aug 19, 2020 · 2 comments

Comments

@manojpreveen
Copy link

python -m albert.run_squad_v1
--albert_config_file=albert/assets/albert_config.json
--output_dir=albert/output
--train_file=albert/train-v1.1.json
--predict_file=albert/dev-v1.1.json
--train_feature_file=albert/output/train.tfrecord
--predict_feature_file=albert/output/dev.tfrecord
--predict_feature_left_file=albert/output/pred_left_file_example.pkl
--albert_hub_module_handle=https://tfhub.dev/google/albert_base/1
--spm_model_file=albert/assets/30k-clean.model
--do_lower_case
--max_seq_length=384
--doc_stride=128
--max_query_length=64
--do_train=true
--do_predict=false
--train_batch_size=16
--predict_batch_size=8
--learning_rate=5e-5
--num_train_epochs=2.0
--warmup_proportion=.1
--save_checkpoints_steps=5000
--n_best_size=20
--max_answer_length=128
--export_dir=albert/modelite

The above is the command I ran to finetune Albert-Base on SQuAD1.1
The finetune was successful and I got both tensorflow checkpoints and the model in saved_model format.

When the Conversion of saved_model to TFLite Model step starts, it's throwing out an error as below :

File "/usr/local/share/anaconda3/lib/python3.7/site-packages/tensorflow_core/lite/python/convert_saved_model.py", line 194, in freeze_saved_model
raise ValueError("SavedModels with assets/ directory are not supported.")
ValueError: SavedModels with assets/ directory are not supported.

Is it just happening for me or is it not supported by tensorflow itself yet.
Is there any workaround to create TFLite model.
Please Help.

Thanks.

@taylorshin
Copy link

I'm having a similar problem. We would greatly appreciate some help/guidance!

@PantherYan
Copy link

PantherYan commented Jan 16, 2021

We also meet this issue, any solutions?

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

No branches or pull requests

3 participants