Error in running align_example.py
See original GitHub issueHi,
I am getting the following error while executing the align_example.py
/home/sriram/anaconda3/envs/simalign/lib/python3.7/site-packages/torch/cuda/__init__.py:52: UserWarning: CUDA initialization: Found no NVIDIA driver on your system. Please check that you have an NVIDIA GPU and installed a driver from http://www.nvidia.com/Download/index.aspx (Triggered internally at /pytorch/c10/cuda/CUDAFunctions.cpp:100.)
return torch._C._cuda_getDeviceCount() > 0
2020-12-29 12:04:07,522 - simalign.simalign - INFO - Initialized the EmbeddingLoader with model: bert-base-multilingual-cased
Traceback (most recent call last):
File "align_example.py", line 7, in <module>
result = model.get_word_aligns(source_sentence, target_sentence)
File "/home/sriram/anaconda3/envs/simalign/lib/python3.7/site-packages/simalign/simalign.py", line 211, in get_word_aligns
vectors = self.embed_loader.get_embed_list([src_sent, trg_sent]).cpu().detach().numpy()
File "/home/sriram/anaconda3/envs/simalign/lib/python3.7/site-packages/simalign/simalign.py", line 66, in get_embed_list
inputs = self.tokenizer(sent_batch, is_pretokenized=True, padding=True, truncation=True, return_tensors="pt")
File "/home/sriram/anaconda3/envs/simalign/lib/python3.7/site-packages/transformers/tokenization_utils_base.py", line 2371, in __call__
**kwargs,
File "/home/sriram/anaconda3/envs/simalign/lib/python3.7/site-packages/transformers/tokenization_utils_base.py", line 2556, in batch_encode_plus
**kwargs,
File "/home/sriram/anaconda3/envs/simalign/lib/python3.7/site-packages/transformers/tokenization_utils.py", line 526, in _batch_encode_plus
ids, pair_ids = ids_or_pair_ids
ValueError: too many values to unpack (expected 2)
Can you please help to resolve this issue?
Thanks, Sriram
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
[ERROR] "RuntimeError: Frame didn't arrive within 5000" #6628
I am trying to run frame_queue_example.py from official repo. I am using D435i realsense camera with NVIDIA Xavier (NX). OS: Ubuntu 18.04 ...
Read more >Passing arguments through a file not running with no error ...
It's a program running through linux that is supposed to print to different statements depending on the argument you use on the command...
Read more >3wkv8mvhv - Java - OneCompiler
AlignExample.java:7: error: package org.apache.poi.hssf.usermodel does not exist ... Write, Run & Share Java code online using OneCompiler's Java online ...
Read more >scroll-snap-type - CSS: Cascading Style Sheets | MDN
The scroll-snap-type CSS property sets how strictly snap points are enforced on the scroll container in case there is one.
Read more >Smart Home Skill Certification Guide | Alexa Skills Kit
For details about providing a full skill description in the Provide a detailed full skill description. Align example phrases with consumer guidance. To...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I solve this issure by upgrading transformers to 4.3.0
Hi @mzeidhassan, no worries. I think it should be fixed now - I tested it with transformers 4.3.0, but it should work with any recent version. Let me know if you have any issues.