Skip to content

Commit

Permalink
[fix] resume on Windows path
Browse files Browse the repository at this point in the history
  • Loading branch information
SuTanTank committed Mar 15, 2022
1 parent bdabdff commit 8683fc3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions mmcv/runner/base_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,8 +371,10 @@ def resume(self,
# Re-calculate the number of iterations when resuming
# models with different number of GPUs
if 'config' in checkpoint['meta']:
config = mmcv.Config.fromstring(
checkpoint['meta']['config'], file_format='.py')
config_str = checkpoint['meta']['config']
# remove the 1st line which is file's fullpath
config_str = config_str[config_str.find('\n') + 1:]
config = mmcv.Config.fromstring(config_str, file_format='.py')
previous_gpu_ids = config.get('gpu_ids', None)
if previous_gpu_ids and len(previous_gpu_ids) > 0 and len(
previous_gpu_ids) != self.world_size:
Expand Down

0 comments on commit 8683fc3

Please sign in to comment.