Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

problem with transcoder

Open
#47 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
python, pytorch

Research direction

Read TransCoder/translate.py around lines 83 and 171, then XLM/src/model/init.py around line 181 where model loading reaches CUDA initialization. Reproduce the reported Translator(params) startup in the shown Python 3.7 environment and inspect the CUDA failure. Done means the cause is identified and a verified resolution or precise environment requirement is recorded.

Written by the indexing model from the issue text.

Description

showing below error
File "TransCoder/translate.py", line 171, in
translator = Translator(params)
File "TransCoder/translate.py", line 83, in init
encoder, decoder = build_model(self.reloaded_params, self.dico)
File "/content/TransCoder/XLM/src/model/init.py", line 181, in build_model
enc_path, map_location=lambda storage, loc: storage.cuda(params.local_rank))
File "/usr/local/lib/python3.7/dist-packages/torch/serialization.py", line 608, in load
return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
File "/usr/local/lib/python3.7/dist-packages/torch/serialization.py", line 787, in _legacy_load
result = unpickler.load()
File "/usr/local/lib/python3.7/dist-packages/torch/serialization.py", line 743, in persistent_load
deserialized_objects[root_key] = restore_location(obj, location)
File "/usr/local/lib/python3.7/dist-packages/torch/serialization.py", line 830, in restore_location
result = map_location(storage, location)
File "/content/TransCoder/XLM/src/model/init.py", line 181, in
enc_path, map_location=lambda storage, loc: storage.cuda(params.local_rank))
File "/usr/local/lib/python3.7/dist-packages/torch/_utils.py", line 71, in _cuda
with torch.cuda.device(device):
File "/usr/local/lib/python3.7/dist-packages/torch/cuda/init.py", line 225, in enter
self.prev_idx = torch.cuda.current_device()
File "/usr/local/lib/python3.7/dist-packages/torch/cuda/init.py", line 432, in current_device
_lazy_init()
File "/usr/local/lib/python3.7/dist-packages/torch/cuda/init.py", line 172, in _lazy_init
torch._C._cuda_init()

Dominant language
Python
Stars
777
Forks
144
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from facebookresearch/CodeGen

All issues in facebookresearch/CodeGen

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.