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

Permission error when using checkpoint #15

Closed ACE07-Sev closed 2 years ago

ACE07-Sev commented 2 years ago

Traceback (most recent call last): File "C:\Users\elmm\Desktop\CQM\QNLP Depression 2.py", line 20, in model = TketModel.from_checkpoint('C:/Users/elmm/Desktop/CQM/runs/Jun08_15-09-45_LT-ELMM-T-MY', backend_config=backend_config) File "C:\Users\elmm\AppData\Local\Programs\Python\Python39\lib\site-packages\lambeq\training\quantum_model.py", line 106, in from_checkpoint checkpoint = Checkpoint.from_file(checkpoint_path) File "C:\Users\elmm\AppData\Local\Programs\Python\Python39\lib\site-packages\lambeq\training\checkpoint.py", line 110, in from_file with open(path, 'rb') as ckp: PermissionError: [Errno 13] Permission denied: 'C:/Users/elmm/Desktop/CQM/runs/Jun08_15-09-45_LT-ELMM-T-MY'

I am trying to use a trained model with the checkpoint. I may have done it wrongly, could I ask for some assistance?

Thommy257 commented 2 years ago

You need to specify the path to the model.lt file:

model = TketModel.from_checkpoint('C:/Users/elmm/Desktop/CQM/runs/Jun08_15-09-45_LT-ELMM-T-MY/model.lt', backend_config=backend_config)