# Quantum Transfer Learning NLP Issue

**URL:** <https://discuss.pennylane.ai/t/quantum-transfer-learning-nlp-issue/1392>\
**Category:** PennyLane Help\
**Created:** [October 5, 2021, 7:56pm UTC](https://discuss.pennylane.ai/t/quantum-transfer-learning-nlp-issue/1392 "2021-10-05T19:56:05Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![dancbeaulieu](https://avatars.discourse-cdn.com/v4/letter/d/7cd45c/32.png) [@dancbeaulieu](https://discuss.pennylane.ai/u/dancbeaulieu)\
**Post date:** [October 5, 2021, 7:56pm UTC](https://discuss.pennylane.ai/t/quantum-transfer-learning-nlp-issue/1392/1 "2021-10-05T19:56:05Z")

</div>

[Transfomer\_IMDB\_TRIM.py](https://discuss.pennylane.ai/uploads/short-url/vxEZCQxVhKPljLoEXG4BJpKqjZO.py) (12.7 KB)

Hello, I can’t get quantum transfer learning to run with a BERT based NLP model and Pennylane. I am not sure what I am doing wrong. It works when I use the pre-made code hosted on the Zapata github using the quantum\_processors.pt weight file. However, when I try to recreate it with my own code it runs with no errors but never interfaces with quantum hardware, and there is no record of it running on the backend.

---

<div class="post-metadata">

**Author:** ![CatalinaAlbornoz](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/catalinaalbornoz/32/1196_2.png) [@CatalinaAlbornoz](https://discuss.pennylane.ai/u/CatalinaAlbornoz)\
**Post date:** [October 6, 2021, 6:31pm UTC](https://discuss.pennylane.ai/t/quantum-transfer-learning-nlp-issue/1392/2 "2021-10-06T18:31:26Z")

</div>

Hi @dancbeaulieu! Thank you for posting your question here.  
Since your file has almost 400 lines of code it’s hard for us to find the problem. Could you try sending us a tiny version of this, which also has the problem?

Thank you!

---

<div class="post-metadata">

**Author:** ![dancbeaulieu](https://avatars.discourse-cdn.com/v4/letter/d/7cd45c/32.png) [@dancbeaulieu](https://discuss.pennylane.ai/u/dancbeaulieu)\
**Post date:** [October 7, 2021, 1:32pm UTC](https://discuss.pennylane.ai/t/quantum-transfer-learning-nlp-issue/1392/3 "2021-10-07T13:32:27Z")

</div>

I will try to reduce the length of the script.

---

<div class="post-metadata">

**Author:** ![dancbeaulieu](https://avatars.discourse-cdn.com/v4/letter/d/7cd45c/32.png) [@dancbeaulieu](https://discuss.pennylane.ai/u/dancbeaulieu)\
**Post date:** [October 7, 2021, 1:56pm UTC](https://discuss.pennylane.ai/t/quantum-transfer-learning-nlp-issue/1392/4 "2021-10-07T13:56:47Z")

</div>

This is about as minimal as I can get the code. It’s 219 lines, and I need help with the Pennylane quantum\_net function on line 107, DressedQuantumNet on 130 or the actual model code on 208. I don’t get an error so I can’t tell why the model code isn’t running, it runs fine but just doesn’t interact with the quantum hardware on AWS Braket or IBM Q.[Transfomer\_IMDB\_minimal2.py](https://discuss.pennylane.ai/uploads/short-url/ziK1paYKm7uvz2hjvVr4wxNbtGC.py) (6.9 KB)

---

<div class="post-metadata">

**Author:** ![CatalinaAlbornoz](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/catalinaalbornoz/32/1196_2.png) [@CatalinaAlbornoz](https://discuss.pennylane.ai/u/CatalinaAlbornoz)\
**Post date:** [October 7, 2021, 7:51pm UTC](https://discuss.pennylane.ai/t/quantum-transfer-learning-nlp-issue/1392/5 "2021-10-07T19:51:37Z")

</div>

Hi @dancbeaulieu, we looked at your code and it looks good. I would suggest you try this [tutorial](https://pennylane.ai/qml/demos/tutorial_qubit_rotation.html) but instead of using the `default.qubit` try using the `AwsDevice`. This will help you see if the problem is with the credentials or with the code, and you can work from there.

Why don’t you try it and let us know how it goes?

---

<div class="post-metadata">

**Author:** ![Ant\_Hayes](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/ant_hayes/32/455_2.png) [@Ant\_Hayes](https://discuss.pennylane.ai/u/Ant_Hayes)\
**Post date:** [October 7, 2021, 7:59pm UTC](https://discuss.pennylane.ai/t/quantum-transfer-learning-nlp-issue/1392/6 "2021-10-07T19:59:19Z")

</div>

Hi @dancbeaulieu,

In addition to @CatalinaAlbornoz’s useful suggestion it may be worth checking if the traceback errors are be being sent to your s3 bucket. Generally we’d expect failed jobs to be visible on the braket dashboard.

Please let us know if you have any more questions

---

<div class="post-metadata">

**Author:** ![dancbeaulieu](https://avatars.discourse-cdn.com/v4/letter/d/7cd45c/32.png) [@dancbeaulieu](https://discuss.pennylane.ai/u/dancbeaulieu)\
**Post date:** [October 7, 2021, 8:17pm UTC](https://discuss.pennylane.ai/t/quantum-transfer-learning-nlp-issue/1392/7 "2021-10-07T20:17:58Z")

</div>

This is the code I am using to initialize the “dev\_remote” device I am using:  
#Pennylane Hardware config  
device\_arn = “arn:aws:braket:::device/quantum-simulator/amazon/sv1”

dev\_remote = qml.device(  
“braket.aws.qubit”,  
device\_arn=device\_arn,  
wires=n\_qubits,  
s3\_destination\_folder=s3\_folder,  
parallel=True  
)

I am not getting errors because it runs fine, it just doesn’t interact with the quantum hardware. There are no traceback errors since it fully works, it just seems to not run on quantum hardware, but it runs completely with no errors, just without interfacing with the quantum hardware. Its very confusing.

---

<div class="post-metadata">

**Author:** ![CatalinaAlbornoz](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/catalinaalbornoz/32/1196_2.png) [@CatalinaAlbornoz](https://discuss.pennylane.ai/u/CatalinaAlbornoz)\
**Post date:** [October 7, 2021, 8:41pm UTC](https://discuss.pennylane.ai/t/quantum-transfer-learning-nlp-issue/1392/8 "2021-10-07T20:41:10Z")

</div>

Yes @dancbeaulieu, it is a strange problem. There are several options:

1. There is an actual error but it’s just not being printed so we don’t know what it is.
2. The code _is_ running on the hardware but there’s just no job id being generated and this leads us to think that it’s running somewhere else.

The thing with the first option is that if it’s not running on the hardware, where is it running? This is the only qml device being specified so I’m thinking it might be option 2.
