zhanghang1989 / zhanghang1989/PyTorch-Encoding

issues with the "DataParallelCriterion"

Open
#116 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
2k
Forks
448
PR merge metrics
No merged PRs in 30d

Description

I employ the DataParallelCriterion like below,

    model = DataParallelModel(deeplab)
    model.train()     
    model.float()
    model.cuda()    
    # .......
    criterion = DataParallelCriterion(criterion)
    criterion.cuda()
    cudnn.benchmark = True

Then I got such errors inform me an error related the line 163 in your parallel.py

Traceback (most recent call last):
  File "train.py", line 160, in <module>
  File "train.py", line 137, in main
    loss = criterion(preds, labels)
  File "/root/miniconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 491, in __call__
    result = self.forward(*input, **kwargs)
  File "/teamscratch/msravcshare/yuyua/OCNet/utils/parallel.py", line 134, in forward
    outputs = _criterion_parallel_apply(replicas, inputs, targets, kwargs)
  File "/teamscratch/msravcshare/yuyua/OCNet/utils/parallel.py", line 188, in _criterion_parallel_apply
    raise output
  File "/teamscratch/msravcshare/yuyua/OCNet/utils/parallel.py", line 163, in _worker
    output = module(*(input + target), **kwargs)
TypeError: can only concatenate list (not "tuple") to list

Contributor guide

No contributing guide indexed for this repository

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.

Research direction

Start with utils/parallel.py at _worker line 163 and follow the call from _criterion_parallel_apply; compare the input and target values passed from train.py at criterion(preds, labels). Reproduce the DataParallelCriterion call and confirm that training no longer raises the reported list/tuple concatenation TypeError.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.