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

training a udify model only for Korean #29

Open
euhkim opened this issue Nov 28, 2021 · 2 comments
Open

training a udify model only for Korean #29

euhkim opened this issue Nov 28, 2021 · 2 comments

Comments

@euhkim
Copy link

euhkim commented Nov 28, 2021

Hello, I am training a udify model only for Korean where I train only on the Korean data from UD2.3. However, I am running into the following issue. The same code runs fine on other languages from UD.
Traceback (most recent call last):
File "train.py", line 113, in
train_model(train_params, serialization_dir, recover=bool(args.resume))
File "/home/user/anaconda3/envs/dependency_parse/lib/python3.7/site-packages/allennlp/commands/train.py", line 226, in train_model
cache_prefix)
File "/home/user/anaconda3/envs/dependency_parse/lib/python3.7/site-packages/allennlp/training/trainer_pieces.py", line 65, in from_params
model = Model.from_params(vocab=vocab, params=params.pop('model'))
File "/home/user/anaconda3/envs/dependency_parse/lib/python3.7/site-packages/allennlp/common/from_params.py", line 365, in from_params
return subclass.from_params(params=params, **extras)
File "/home/user/anaconda3/envs/dependency_parse/lib/python3.7/site-packages/allennlp/common/from_params.py", line 386, in from_params
kwargs = create_kwargs(cls, params, **extras)
File "/home/user/anaconda3/envs/dependency_parse/lib/python3.7/site-packages/allennlp/common/from_params.py", line 133, in create_kwargs
kwargs[name] = construct_arg(cls, name, annotation, param.default, params, **extras)
File "/home/user/anaconda3/envs/dependency_parse/lib/python3.7/site-packages/allennlp/common/from_params.py", line 257, in construct_arg
value_dict[key] = value_cls.from_params(params=value_params, **subextras)
File "/home/user/anaconda3/envs/dependency_parse/lib/python3.7/site-packages/allennlp/common/from_params.py", line 365, in from_params
return subclass.from_params(params=params, **extras)
File "/home/user/anaconda3/envs/dependency_parse/lib/python3.7/site-packages/allennlp/common/from_params.py", line 388, in from_params
return cls(**kwargs) # type: ignore
File "/home/user/udify-master/udify/models/tag_decoder.py", line 105, in init
div_value=4.0)
File "/home/user/anaconda3/envs/dependency_parse/lib/python3.7/site-packages/torch/nn/modules/adaptive.py", line 133, in init
raise ValueError("cutoffs should be a sequence of unique, positive "
ValueError: cutoffs should be a sequence of unique, positive integers sorted in an increasing order, where each value is between 1 and n_classes-1

@dfvalio
Copy link

dfvalio commented Jan 4, 2022

Hi,
I am facing the exact same problem with the following languages: Hindi, Thai, Chinese and Japanese. Have you been able to solve your issue? If so, could you please share the solution?
Thank you in advance.

@ziqianPeng
Copy link

ziqianPeng commented Jul 19, 2022

Hello, I encountered the same error with the languages Chinese and Japanese, I found that in udify/models/tag_decoder.py, the adaptive_cutoffs I got was [0,0] that caused the issue. So I change self.adaptive as false if the self.num_classes is small, it seems that this solves my problem.

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

3 participants