Skip to content

Commit

Permalink
Remove torch.xpu.optimize for semantic_segmentation task (#3172)
Browse files Browse the repository at this point in the history
* remove torch.optimize

* fix pre-commit
  • Loading branch information
kprokofi authored Apr 9, 2024
1 parent 4ce3e40 commit a999372
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/otx/algorithms/segmentation/adapters/mmseg/apis/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,7 @@ def train_segmentor(model, dataset, cfg, distributed=False, validate=False, time
if cfg.device == "xpu":
if cfg.optimizer_config.get("bf16_training", False):
logger.warning("XPU supports fp32 training only currently.")
dtype = torch.float32
model.train()
model, optimizer = torch.xpu.optimize(model, optimizer=optimizer, dtype=dtype)

if "bf16_training" in cfg.optimizer_config:
# Remove unused parameters in runner
Expand Down

0 comments on commit a999372

Please sign in to comment.