Update utils.py
Browse files
utils.py
CHANGED
|
@@ -63,7 +63,7 @@ def download_checkpoint(
|
|
| 63 |
|
| 64 |
|
| 65 |
def load_checkpoint(checkpoint_path, model, optimizer=None, skip_optimizer=False):
|
| 66 |
-
|
| 67 |
checkpoint_dict = torch.load(checkpoint_path, map_location="cpu")
|
| 68 |
iteration = checkpoint_dict["iteration"]
|
| 69 |
learning_rate = checkpoint_dict["learning_rate"]
|
|
|
|
| 63 |
|
| 64 |
|
| 65 |
def load_checkpoint(checkpoint_path, model, optimizer=None, skip_optimizer=False):
|
| 66 |
+
assert os.path.isfile(checkpoint_path)
|
| 67 |
checkpoint_dict = torch.load(checkpoint_path, map_location="cpu")
|
| 68 |
iteration = checkpoint_dict["iteration"]
|
| 69 |
learning_rate = checkpoint_dict["learning_rate"]
|