Skip to content

Commit

Permalink
fix: avoid non-deterministic error
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanxingql committed Oct 3, 2024
1 parent 6aefea2 commit 9f5f8ee
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion basicsr
4 changes: 2 additions & 2 deletions doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ powerqe
conda activate pqe

#CUDA_VISIBLE_DEVICES=0 scripts/train.sh 1 options/train/ESRGAN/RRDBNet_DIV2K_LMDB_G1.yml --auto_resume
[CUBLAS_WORKSPACE_CONFIG=:4096:8] CUDA_VISIBLE_DEVICES=<gpus> [PORT=<master_port>] scripts/train.sh <num_gpus> <cfg_path> [--auto_resume] [--debug] [--force_yml <key>=<value>]
CUDA_VISIBLE_DEVICES=<gpus> [PORT=<master_port>] scripts/train.sh <num_gpus> <cfg_path> [--auto_resume] [--debug] [--force_yml <key>=<value>]
```

- `auto_resume`: Automatically resume from the latest existing checkpoint.
Expand All @@ -147,7 +147,7 @@ conda activate pqe
conda activate pqe

#CUDA_VISIBLE_DEVICES=0 scripts/test.sh 1 options/test/ESRGAN/RRDBNet_DIV2K_LMDB_G1_latest.yml --force_yml path:pretrain_network_g=experiments/train_ESRGAN_RRDBNet_DIV2K_LMDB_G1/models/net_g_600000.pth
[CUBLAS_WORKSPACE_CONFIG=:4096:8] CUDA_VISIBLE_DEVICES=<gpus> [PORT=<master_port>] scripts/test.sh <num_gpus> <cfg_path> [--force_yml <key>=<value>]
CUDA_VISIBLE_DEVICES=<gpus> [PORT=<master_port>] scripts/test.sh <num_gpus> <cfg_path> [--force_yml <key>=<value>]
```

- Most models support only single-GPU testing, even when multi-GPU testing is requested.
Expand Down
2 changes: 1 addition & 1 deletion powerqe/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def test_pipeline(root_path):
if opt["reproduce"]:
torch.backends.cudnn.benchmark = False
torch.backends.cudnn.deterministic = True
torch.use_deterministic_algorithms(True)
torch.use_deterministic_algorithms(True, warn_only=True)
else:
torch.backends.cudnn.benchmark = True
# torch.backends.cudnn.deterministic = True
Expand Down
2 changes: 1 addition & 1 deletion powerqe/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def train_pipeline(root_path):
if opt["reproduce"]:
torch.backends.cudnn.benchmark = False
torch.backends.cudnn.deterministic = True
torch.use_deterministic_algorithms(True)
torch.use_deterministic_algorithms(True, warn_only=True)
else:
torch.backends.cudnn.benchmark = True
# torch.backends.cudnn.deterministic = True
Expand Down

0 comments on commit 9f5f8ee

Please sign in to comment.