Skip to content

Commit

Permalink
fixed error cannot import _download_url_to_file with pytorch 1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
tianzhi0549 committed May 29, 2019
1 parent d02e7d5 commit ff8376b
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions maskrcnn_benchmark/utils/model_zoo.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@
import os
import sys

from torch.utils.model_zoo import _download_url_to_file
from torch.utils.model_zoo import urlparse
from torch.utils.model_zoo import HASH_REGEX
try:
from torch.utils.model_zoo import _download_url_to_file
from torch.utils.model_zoo import urlparse
from torch.utils.model_zoo import HASH_REGEX
except:
from torch.hub import _download_url_to_file
from torch.hub import urlparse
from torch.hub import HASH_REGEX

from maskrcnn_benchmark.utils.comm import is_main_process
from maskrcnn_benchmark.utils.comm import synchronize
Expand Down

0 comments on commit ff8376b

Please sign in to comment.