Comments (9)
Hi,
thanks for submitting this issue, this has happened before and we are currently investigate it. Could you please give us the following information about your system:
- Which python version do you use?
- Do you use anaconda?
- Which IDE do you use?
- Are you running your code in a notebook/ ipython shell?
In the meantime, you can download the model through this link, extract it, and pass the path to the extracted files to the BobcatParser
:
from lambeq import BobcatParser
parser = BobcatParser(model='path/to/model')
diagram = parser.sentence2diagram('This is a test sentence')
diagram.draw()
from lambeq.
I have the same problem with SSL certificate. I have tried with the following configuration:
- Python version 3.8
- Not using Anaconda
- Jupyter-lab on browser (tried with both Opera GX and Google Chrome) with a notebook
- I tried even with the Python Shell, still doesn't work.
I also downloaded the model from the link you provided and extracted it. I copy-pasted your code, and tried as paths the relative paths and abosulte paths (I/O is working properly with other files) of both the directory containing the model and the file 'pytorch_model.bin', but still the program returns the same SSL error.
Is there something i am doing wrong while loading the local file? Thanks for your help.
from lambeq.
Sorry, the download link might have been deprecated. Can you try downloading the model from https://qnlp.cambridgequantum.com/models/bert/latest/model.tar.gz?
Also, I realised that the correct variable is model_name_or_path
. So this will work:
from lambeq import BobcatParser
parser = BobcatParser(model_name_or_path='path/to/model')
diagram = parser.sentence2diagram('This is a test sentence')
diagram.draw()
Many apologies!
Update: the link was broken.
from lambeq.
I downloaded the model.tar.gz. How shall I set the Parser path to it? I'm not very familiar with .tar.gz files.
from lambeq.
Hi @ACE07-Sev, .tar.gz is an compressed file. You need to extract it first. Maybe this page helps: https://superuser.com/questions/215629/how-to-open-a-tar-gz-file-in-windows
from lambeq.
Hi yes now it's fixed. I extracted it and then addressed the file path to that. thank you so much
from lambeq.
Hi sorry, I ran the model and got this error :
2022-06-06 18:03:29.258323: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cudart64_110.dll'; dlerror: cudart64_110.dll not found
2022-06-06 18:03:29.259328: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
Traceback (most recent call last):
File "C:\Users\elmm\Desktop\CQM\QNLP Depression.py", line 104, in
trainer.fit(train_dataset, val_dataset, logging_step=12)
File "C:\Users\elmm\AppData\Local\Programs\Python\Python39\lib\site-packages\lambeq\training\trainer.py", line 365, in fit
y_hat, loss = self.training_step(batch)
File "C:\Users\elmm\AppData\Local\Programs\Python\Python39\lib\site-packages\lambeq\training\quantum_trainer.py", line 149, in training_step
y_hat, loss = self.optimizer.backward(batch)
File "C:\Users\elmm\AppData\Local\Programs\Python\Python39\lib\site-packages\lambeq\training\spsa_optimizer.py", line 125, in backward
y0 = self.model(diagrams)
File "C:\Users\elmm\AppData\Local\Programs\Python\Python39\lib\site-packages\lambeq\training\model.py", line 59, in call
return self.forward(*args, **kwds)
File "C:\Users\elmm\AppData\Local\Programs\Python\Python39\lib\site-packages\lambeq\training\tket_model.py", line 131, in forward
return self.get_diagram_output(x)
File "C:\Users\elmm\AppData\Local\Programs\Python\Python39\lib\site-packages\lambeq\training\tket_model.py", line 103, in get_diagram_output
seed=self._randint()
File "C:\Users\elmm\AppData\Local\Programs\Python\Python39\lib\site-packages\lambeq\training\tket_model.py", line 71, in _randint
return np.random.randint(low, high)
File "mtrand.pyx", line 746, in numpy.random.mtrand.RandomState.randint
File "_bounded_integers.pyx", line 1334, in numpy.random._bounded_integers._rand_int32
ValueError: low is out of bounds for int32
The parser is working now so I think besides this we can close the issue.
from lambeq.
I tried changing the seed to 7 for instance but still got the error. May I ask how can I resolve this?
from lambeq.
Follow-up in #12
from lambeq.
Related Issues (20)
- Method or class for composing more than 1 free wires into one HOT 1
- Add more tutorials and example notebooks in the documentation HOT 2
- Ansatz for performing amplitude encoding - Enhancement HOT 4
- Bobcat fails with extra space tokens HOT 3
- BobCat fails to parse with extra addition of "the" to a sentence. HOT 2
- lambeq pytest: No module named lambeq.version HOT 2
- IQPAnsatz: shape error as changing number of qubits for atomic types HOT 4
- Lambeq installation Error HOT 2
- Error whem training Classical Pipeline with Spider Ansatz HOT 4
- Key error in Accuracy function HOT 2
- PicklingError HOT 6
- Anastz Customization HOT 5
- TypeError when construct quantum circuits for multi-classification task HOT 11
- Python 3.12 Type Error in Mac Environment when Loading Library HOT 5
- PennyLane training problem HOT 2
- parameterization tutorial example failing HOT 5
- [unitaryHACK 2024] Implement ASCII drawing for all lambeq diagrams
- [unitaryHACK 2024] Improve RemoveCupsRewriter
- [unitaryHACK 2024] Add frames in lambeq HOT 1
- [unitaryHACK 2024] Make PytorchModel work with quantum circuits HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lambeq.