Giter Club home page Giter Club logo

Comments (5)

hankcs avatar hankcs commented on August 24, 2024

The embedding file in config.ini is referring to /home/zyang68/data/trained_embeddings/dim100.vec.bak. Now I changed it to data/embedding/fasttext100.vec.txt. Please use the new config.ini in ~/elit/data/model/dep/jumbo-fasttext100.

from elit.

imgarylai avatar imgarylai commented on August 24, 2024

Files have been updated but same errors.
Information below are from server, not from ainos.

$ cat /resources/elit/data/model/dep/jumbo-fasttext100/config.ini
[Data]
pretrained_embeddings_file = data/embedding/fasttext100.vec.txt
data_dir = data/dat
train_file = %(data_dir)s/en-ddr.trn.conllx
dev_file = %(data_dir)s/en-ddr.dev.conllx
test_file = %(data_dir)s/en-ddr.tst.conllx
min_occur_count = 2

[Save]
save_dir = data/model/dep/jumbo-fasttext100
config_file = %(save_dir)s/config.ini
save_model_path = %(save_dir)s/model.txt
save_vocab_path = %(save_dir)s/vocab.pkl

[Network]
lstm_layers = 3
char_dims = 0
word_dims = 100
tag_dims = 100
dropout_emb = 0.33
lstm_hiddens = 400
dropout_lstm_input = 0.33
dropout_lstm_hidden = 0.33
mlp_arc_size = 500
mlp_rel_size = 100
dropout_mlp = 0.33

[Optimizer]
learning_rate = 2e-3
decay = .75
decay_steps = 5000
beta_1 = .9
beta_2 = .9
epsilon = 1e-12

[Run]
num_buckets_train = 40
num_buckets_valid = 10
num_buckets_test = %(num_buckets_train)s
train_iters = 50000
train_batch_size = 5000
test_batch_size = %(train_batch_size)s
validate_every = 100
save_after = 5000
debug = false
$ ls data/embedding/
fasttext100.vec.txt  flair.vec.txt  glove  glove.6B.100d.debug.txt  glove.6B.100d.txt

from elit.

hankcs avatar hankcs commented on August 24, 2024

Yes, I updated the first line data/embedding/fasttext100.vec.txt to %(data_dir)s/data/embedding/fasttext100.vec.txt. Now it should work.

from elit.

imgarylai avatar imgarylai commented on August 24, 2024
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/django/core/handlers/wsgi.py", line 142, in __call__
    response = self.get_response(request)
  File "/usr/local/lib/python3.5/dist-packages/django/core/handlers/base.py", line 78, in get_response
    response = self._middleware_chain(request)
  File "/usr/local/lib/python3.5/dist-packages/django/core/handlers/exception.py", line 36, in inner
    response = response_for_exception(request, exc)
  File "/usr/local/lib/python3.5/dist-packages/django/core/handlers/exception.py", line 90, in response_for_exception
    response = handle_uncaught_exception(request, get_resolver(get_urlconf()), sys.exc_info())
  File "/usr/local/lib/python3.5/dist-packages/django/core/handlers/exception.py", line 128, in handle_uncaught_exception
    callback, param_dict = resolver.resolve_error_handler(500)
  File "/usr/local/lib/python3.5/dist-packages/django/urls/resolvers.py", line 546, in resolve_error_handler
    callback = getattr(self.urlconf_module, 'handler%s' % view_type, None)
  File "/usr/local/lib/python3.5/dist-packages/django/utils/functional.py", line 37, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/usr/local/lib/python3.5/dist-packages/django/urls/resolvers.py", line 526, in urlconf_module
    return import_module(self.urlconf_name)
  File "/usr/lib/python3.5/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 986, in _gcd_import
  File "<frozen importlib._bootstrap>", line 969, in _find_and_load
  File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 665, in exec_module
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
  File "./config/urls.py", line 23, in <module>
    path('api/', include('api.urls')),
  File "/usr/local/lib/python3.5/dist-packages/django/urls/conf.py", line 34, in include
    urlconf_module = import_module(urlconf_module)
  File "/usr/lib/python3.5/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 986, in _gcd_import
  File "<frozen importlib._bootstrap>", line 969, in _find_and_load
  File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 665, in exec_module
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
  File "./api/urls.py", line 18, in <module>
    from api import views
  File "./api/views.py", line 11, in <module>
    from api.components.elit import elit_tok_lexrule_en, elit_dep_biaffine_en_mixed, get_ctx
  File "./api/components/elit.py", line 71, in <module>
    elit_dep_biaffine_en_mixed.load('{}/data/model/dep/jumbo-fasttext100'.format(ELIT_PATH))
  File "/usr/local/lib/python3.5/dist-packages/elit/nlp/dep/parser/parser.py", line 168, in load
    self._parser = self._create_parser(self._config, self._vocab)
  File "/usr/local/lib/python3.5/dist-packages/elit/nlp/dep/parser/parser.py", line 209, in _create_parser
    config.mlp_rel_size, config.dropout_mlp, config.debug)
  File "/usr/local/lib/python3.5/dist-packages/elit/nlp/dep/parser/biaffine_parser.py", line 55, in __init__
    trainable=False) if vocab.has_pret_embs() else None
  File "/usr/local/lib/python3.5/dist-packages/elit/nlp/dep/parser/common/data.py", line 157, in get_pret_embs
    with open(self._pret_file) as f:
FileNotFoundError: [Errno 2] No such file or directory: 'data/embedding/fasttext100.vec.txt'

This place still use project relative path.

Please make sure all the paths in the setting are not project relative path.

from elit.

hankcs avatar hankcs commented on August 24, 2024

Hi Gary, sorry for the delay, just survived final weeks. In this patch, we can override the embedding path:

parser.load(model_path, embedding_path)

from elit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.