JDAI-CV / fast-reid

SOTA Re-identification Methods and Toolbox
Apache License 2.0
3.43k stars 838 forks source link

urllib.error.HTTPError: HTTP Error 403: Forbidden #207

Closed TCHeish closed 4 years ago

TCHeish commented 4 years ago

Hi, I got a http error during training.

Here's the cmd: python3 tools/train_net.py --config-file='configs/Market1501/bagtricks_S50.yml' MODEL.DEVICE "cuda:0"

Here's the config: CUDNN_BENCHMARK: True DATALOADER: NAIVE_WAY: True NUM_INSTANCE: 4 NUM_WORKERS: 8 PK_SAMPLER: True DATASETS: COMBINEALL: False NAMES: ('Market1501',) TESTS: ('Market1501',) INPUT: DO_AUGMIX: False DO_AUTOAUG: False DO_CJ: False DO_FLIP: True DO_PAD: True FLIP_PROB: 0.5 PADDING: 10 PADDING_MODE: constant REA: ENABLED: True MEAN: [123.675, 116.28, 103.53] PROB: 0.5 RPT: ENABLED: False PROB: 0.5 SIZE_TEST: [256, 128] SIZE_TRAIN: [256, 128] MODEL: BACKBONE: DEPTH: 50 LAST_STRIDE: 1 NAME: build_resnest_backbone NORM: BN NORM_SPLIT: 1 PRETRAIN: True PRETRAIN_PATH: VOLUME: 800y WITH_IBN: False WITH_NL: False WITH_SE: False DEVICE: cuda:0 FREEZE_LAYERS: [''] HEADS: CLS_LAYER: linear IN_FEAT: 2048 MARGIN: 0.15 NAME: BNneckHead NECK_FEAT: before NORM: BN NORM_SPLIT: 1 NUM_CLASSES: 0 POOL_LAYER: avgpool REDUCTION_DIM: 512 SCALE: 128 LOSSES: CE: ALPHA: 0.2 EPSILON: 0.1 SCALE: 1.0 CIRCLE: ALPHA: 128 MARGIN: 0.25 SCALE: 1.0 FL: ALPHA: 0.25 GAMMA: 2 SCALE: 1.0 NAME: ('CrossEntropyLoss', 'TripletLoss') TRI: HARD_MINING: True MARGIN: 0.3 NORM_FEAT: False SCALE: 1.0 META_ARCHITECTURE: Baseline PIXEL_MEAN: [123.675, 116.28, 103.53] PIXEL_STD: [58.395, 57.120000000000005, 57.375] WEIGHTS: OUTPUT_DIR: logs/market1501/bagtricks_S50 SOLVER: BASE_LR: 0.00035 BIAS_LR_FACTOR: 2.0 CHECKPOINT_PERIOD: 60 DELAY_ITERS: 0 ETA_MIN_LR: 3e-07 FREEZE_ITERS: 0 GAMMA: 0.1 HEADS_LR_FACTOR: 1.0 IMS_PER_BATCH: 16 MAX_ITER: 120 MOMENTUM: 0.9 OPT: Adam SCHED: WarmupMultiStepLR STEPS: [40, 90] SWA: ENABLED: False ETA_MIN_LR: 3.5e-06 ITER: 10 LR_FACTOR: 10.0 LR_SCHED: False PERIOD: 2 WARMUP_FACTOR: 0.01 WARMUP_ITERS: 10 WARMUP_METHOD: linear WEIGHT_DECAY: 0.0005 WEIGHT_DECAY_BIAS: 0.0005 TEST: AQE: ALPHA: 3.0 ENABLED: False QE_K: 5 QE_TIME: 1 EVAL_PERIOD: 30 IMS_PER_BATCH: 16 METRIC: cosine PRECISE_BN: DATASET: Market1501 ENABLED: False NUM_ITER: 300 RERANK: ENABLED: False K1: 20 K2: 6 LAMBDA: 0.3

And the error msg: Downloading: "https://hangzh.s3.amazonaws.com/encoding/models/resnest50-528c19ca.pth" to /root/.cache/torch/checkpoints/resnest50-528c19ca.pth Traceback (most recent call last): File "tools/train_net.py", line 81, in args=(args,), File "./fastreid/engine/launch.py", line 71, in launch main_func(args) File "tools/train_net.py", line 67, in main trainer = Trainer(cfg) File "./fastreid/engine/defaults.py", line 206, in init model = self.build_model(cfg) File "./fastreid/engine/defaults.py", line 377, in build_model model = build_model(cfg) File "./fastreid/modeling/meta_arch/build.py", line 24, in build_model model = META_ARCH_REGISTRY.get(meta_arch)(cfg) File "./fastreid/modeling/meta_arch/baseline.py", line 27, in init self.backbone = build_backbone(cfg) File "./fastreid/modeling/backbones/build.py", line 27, in build_backbone backbone = BACKBONE_REGISTRY.get(backbone_name)(cfg) File "./fastreid/modeling/backbones/resnest.py", line 390, in build_resnest_backbone model_urls['resnest' + str(depth)], progress=True, check_hash=True) File "/usr/local/lib/python3.6/dist-packages/torch/hub.py", line 492, in load_state_dict_from_url download_url_to_file(url, cached_file, hash_prefix, progress=progress) File "/usr/local/lib/python3.6/dist-packages/torch/hub.py", line 391, in download_url_to_file u = urlopen(url) File "/usr/lib/python3.6/urllib/request.py", line 223, in urlopen return opener.open(url, data, timeout) File "/usr/lib/python3.6/urllib/request.py", line 532, in open response = meth(req, response) File "/usr/lib/python3.6/urllib/request.py", line 642, in http_response 'http', request, response, code, msg, hdrs) File "/usr/lib/python3.6/urllib/request.py", line 570, in error return self._call_chain(args) File "/usr/lib/python3.6/urllib/request.py", line 504, in _call_chain result = func(*args) File "/usr/lib/python3.6/urllib/request.py", line 650, in http_error_default raise HTTPError(req.full_url, code, msg, hdrs, fp) urllib.error.HTTPError: HTTP Error 403: Forbidden

L1aoXingyu commented 4 years ago

应该是你的服务器连不了网,你得自己去 https://github.com/XingangPan/IBN-Net 这里自己下载 pre-train model,然后放到 ~/.cache/torch/checkpoints 里面

TCHeish commented 4 years ago

Thanks for the reply,

I just change the url in resnest.py

_url_format = 'https://hangzh.s3.amazonaws.com/encoding/models/{}-{}.pth'

_url_format = 'https://s3.us-west-1.wasabisys.com/resnest/torch/{}-{}.pth'

and it's working now.

L1aoXingyu commented 4 years ago

Oh, I thought you want to download ibn-net pre-train model. Maybe resnest pre-train model has been changed by zhanghang.