CQCL / lambeq

A high-level Python library for Quantum Natural Language Processing
https://cqcl.github.io/lambeq-docs
Apache License 2.0
451 stars 108 forks source link

KeyError : am__n.r@s@s.l@n_3 #19

Closed ACE07-Sev closed 2 years ago

ACE07-Sev commented 2 years ago

Traceback (most recent call last): File "C:\Users\elmm\AppData\Local\Programs\Python\Python39\lib\site-packages\lambeq\training\numpy_model.py", line 154, in get_diagram_output values.append(parameters[sym]) KeyError: am__n.r@s@s.l@n_3

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\elmm\Desktop\CQM\QNLP Depression 2.py", line 125, in prediction = model.forward([diagram]) File "C:\Users\elmm\AppData\Local\Programs\Python\Python39\lib\site-packages\lambeq\training\numpy_model.py", line 185, in forward return self.get_diagram_output(x) File "C:\Users\elmm\AppData\Local\Programs\Python\Python39\lib\site-packages\lambeq\training\numpy_model.py", line 156, in get_diagram_output raise KeyError(f'Unknown symbol {sym!r}.') KeyError: 'Unknown symbol am__n.r@s@s.l@n_3.'

I ran "I am depressed" and got this error. Any resolves?

y-richie-y commented 2 years ago

Thanks for the issue! As we discussed on discord, you tried evaluating IQP circuits with 2 layers on a model that has been trained on 1 layer, hence the missing parameters.