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
Can't load model in GCS directly #13
Comments
That's an inconvenience of GCS. The sentence piece "Load" function can only access "local" files (only |
You should load sentencepiece model in local dir instead of GCS. For example, in Colab, you should manually upload spiece.model in your notebook. |
I have tried to use the local files. But it showed another error:
I run the project on the console of Google Cloud Platform. |
maybe you should post your shell script here |
For example: |
how about adding |
It still shows the same error.
The solution to this problem I searched is to use GCS path instead of the local path. After using GCS, the error which I mentioned before shows. |
For me, I use |
After I changing 'output_dir', 'model_dir' and 'init_checkpoint' to GCS and remaining other directories locally, it works. Caused by op u'input_pipeline_task0/while/IteratorGetNext', defined at: OutOfRangeError (see above for traceback): End of sequence |
As the example script # Local path for model config & sentence-piece model
--model_config_path=${INIT_CKPT_DIR}/xlnet_config.json \
--spiece_model_file=${INIT_CKPT_DIR}/spiece.model \
# Google storage path for `init_checkpoint`, processed data dir `output_dir` and `model_dir`
--output_dir=${GS_PROC_DATA_DIR} \
--init_checkpoint=${GS_INIT_CKPT_DIR}/xlnet_model.ckpt \
--model_dir=${GS_MODEL_DIR} \
# Local path for raw input data
--train_file=${SQUAD_DIR}/train-v2.0.json \
--predict_file=${SQUAD_DIR}/dev-v2.0.json \
|
Thanks for your help. There are still some problems. If it still not work, I will start another issue. |
When I wanted to run the model on TPU, I used "gs://..." replace the ${LARGE_DIR}. But it turns out the IOError.
Traceback (most recent call last): File "run_classifier.py", line 903, in <module> tf.app.run() File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py", line 125, in run _sys.exit(main(argv)) File "run_classifier.py", line 722, in main sp.Load(FLAGS.spiece_model_file) File "/usr/local/lib/python2.7/dist-packages/sentencepiece.py", line 118, in Load return _sentencepiece.SentencePieceProcessor_Load(self, filename) IOError: Not found: "gs://ykproject/pre-trained/xlnet_cased_L-24_H-1024_A-16/spiece.model": No such file or directory Error #2
Did this mean sp.Load() doesn't support load GCS file? And I should change the code. Or something other should I do?
The text was updated successfully, but these errors were encountered: