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

Error report about running code in edge probing example notebook. #1342

Open
24kMengXin opened this issue Oct 17, 2021 · 2 comments
Open

Error report about running code in edge probing example notebook. #1342

24kMengXin opened this issue Oct 17, 2021 · 2 comments

Comments

@24kMengXin
Copy link

When I run the 'jiant_EdgeProbing_Example.ipynb', it reports an error

KeyError: <TaskTypes.MULTI_LABEL_SPAN_CLASSIFICATION: 'multi_label_span_classification'>

in the train step after display

Creating Tasks:
semeval (SemevalTask): ./tasks/configs/semeval_config.json

Here is the detail of traceback:

Creating Tasks:
semeval (SemevalTask): ./tasks/configs/semeval_config.json
Traceback (most recent call last):
File "/content/anaconda3/lib/python3.8/site-packages/IPython/core/interactiveshell.py", line 3437, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "", line 1, in
runfile('/content/code/test_jiant.py', wdir='/data/home/mc05413/code/mbart_probe_discourse')
File "/content/.pycharm_helpers/pydev/_pydev_bundle/pydev_umd.py", line 197, in runfile
pydev_imports.execfile(filename, global_vars, local_vars) # execute the script
File "/content/.pycharm_helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "/content/code/test_jiant.py", line 127, in
main_runscript.run_loop(run_args)
File "/content/code/jiant/proj/main/runscript.py", line 140, in run_loop
runner = setup_runner(
File "/content/code/jiant/proj/main/runscript.py", line 86, in setup_runner
jiant_model = jiant_model_setup.setup_jiant_model(
File "/content/code/jiant/proj/main/modeling/model_setup.py", line 59, in setup_jiant_model
taskmodels_dict = {
File "/content/code/jiant/proj/main/modeling/model_setup.py", line 60, in
taskmodel_name: create_taskmodel(
File "/content/code/jiant/proj/main/modeling/model_setup.py", line 284, in create_taskmodel
head = JiantHeadFactory()(task, **head_kwargs)
File "/content/jiant/proj/main/modeling/heads.py", line 69, in call
head_class = self.registry[task.TASK_TYPE]
KeyError: <TaskTypes.MULTI_LABEL_SPAN_CLASSIFICATION: 'multi_label_span_classification'>

I just copy the code from example notebook and change nothing (I put the .py file in a same content with jiant package).

How to solve this problem? Thank you very much.

@Chang-Hongyang
Copy link

I also encountered this mistake. After reading the code, I found to be in the jiant/proj/main/modeling/heads. py file lacks of the definition of the classifier, although in taskmodel. py file has corresponding model classes.

@cl-trier
Copy link

so how to fix this?

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