-1

I am using Azure Machine Learning and Azure Databricks. In Azure Databricks I have a script.py written by %% command (%%write script.py).

In this script I tried to load cc.fr.300.bin that is saved as a model in Azure Machine Learning.

I did this:

import fasttext
fr_model_path = os.path.join(os.getenv('AZUREML_MODEL_DIR'), 'cc.fr.300.bin')
fr_model = fasttext.load_model(fr_model_path)

But I have the error :

File "/structure/azureml-app/script.py", line 134, in init
    fr_model = fasttext.load_model(fr_model_path)
  File "/azureml-envs/azureml_d7.../lib/python3.6/site-packages/fasttext/FastText.py", line 441, in load_model
    return _FastText(model_path=path)
  File "/azureml-envs/azureml_d7.../lib/python3.6/site-packages/fasttext/FastText.py", line 98, in __init__
    self.f.loadModel(model_path)
ValueError: /var/azureml-app/azureml-models/test/1/cc.fr.300.bin cannot be opened for loading!

What can I do ?

codelifevcd
  • 175
  • 1
  • 10

1 Answers1

0

cc.nl.300.bin maybe a old version file. The latest fasttext cannot load it.

You can try it as following:

pip uninstall fasttext


pip install fasttext==0.6.0

Refer - https://pypi.org/project/fasttext/0.6.0/

Abhishek K
  • 3,047
  • 1
  • 6
  • 19