zhanghang1989 / zhanghang1989/PyTorch-Encoding

ImportError: cannot import name 'SyncBatchNorm'

Open
#209 2 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

when I train the model using
CUDA_VISIBLE_DEVICES=0,1 python train.py --dataset pascal_voc --model encnet --aux --se-loss at the experiments/segmentation branch, I encouter this problem

File "experiments/segmentation/train.py", line 18, in
from encoding.nn import SegmentationLosses, SyncBatchNorm, OHEMSegmentationLosses
ImportError: cannot import name 'SyncBatchNorm'

can u tell me how to fix it?

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

Reproduce the failure with the provided CUDA_VISIBLE_DEVICES command from experiments/segmentation, starting at experiments/segmentation/train.py line 18. Inspect how encoding.nn exposes SyncBatchNorm and verify that the training command no longer raises the ImportError.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
computer-vision, machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.