Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue when running sample code. #2

Open
couragelfyang opened this issue Jan 17, 2024 · 0 comments
Open

Issue when running sample code. #2

couragelfyang opened this issue Jan 17, 2024 · 0 comments

Comments

@couragelfyang
Copy link

I encountered issues when running run_shot_study_mvtec_coreset_augmentations.sh. Any suggestion?

k-shot: 1
run: 0
category: bottle



Loading model antialiased_wide_resnet50_2 from antialias_cnn
Traceback (most recent call last):
  File "scripts/few_shot_training.py", line 304, in <module>
    train()
  File "scripts/few_shot_training.py", line 284, in train
    train_step(
  File "scripts/few_shot_training.py", line 91, in train_step
    model = get_model(config)
  File "/net/papilio/storage5/nedo-otsl/longfei/patchcore-few-shot/src/anomalib/models/__init__.py", line 65, in get_model
    model = getattr(module, f"{_snake_to_pascal_case(config.model.name)}Lightning")(config)
  File "/net/papilio/storage5/nedo-otsl/longfei/patchcore-few-shot/src/anomalib/models/patchcore/lightning_model.py", line 131, in __init__
    super().__init__(
  File "/net/papilio/storage5/nedo-otsl/longfei/patchcore-few-shot/src/anomalib/models/patchcore/lightning_model.py", line 49, in __init__
    self.model: PatchcoreModel = PatchcoreModel(
  File "/net/papilio/storage5/nedo-otsl/longfei/patchcore-few-shot/src/anomalib/models/patchcore/torch_model.py", line 62, in __init__
    model = antialiased_cnns.wide_resnet50_2(pretrained=True)
  File "/net/papilio/storage6/longfei/anaconda3/envs/nedo-fewshot/lib/python3.8/site-packages/antialiased_cnns/resnet.py", line 406, in wide_resnet50_2
    model.load_state_dict(model_zoo.load_url(model_urls['wide_resnet50_2_lpf4_finetune'], map_location='cpu', check_hash=True)['state_dict'])
  File "/net/papilio/storage6/longfei/anaconda3/envs/nedo-fewshot/lib/python3.8/site-packages/torch/hub.py", line 766, in load_state_dict_from_url
    download_url_to_file(url, cached_file, hash_prefix, progress=progress)
  File "/net/papilio/storage6/longfei/anaconda3/envs/nedo-fewshot/lib/python3.8/site-packages/torch/hub.py", line 620, in download_url_to_file
    u = urlopen(req)
  File "/net/papilio/storage6/longfei/anaconda3/envs/nedo-fewshot/lib/python3.8/urllib/request.py", line 222, in urlopen
    return opener.open(url, data, timeout)
  File "/net/papilio/storage6/longfei/anaconda3/envs/nedo-fewshot/lib/python3.8/urllib/request.py", line 531, in open
    response = meth(req, response)
  File "/net/papilio/storage6/longfei/anaconda3/envs/nedo-fewshot/lib/python3.8/urllib/request.py", line 640, in http_response
    response = self.parent.error(
  File "/net/papilio/storage6/longfei/anaconda3/envs/nedo-fewshot/lib/python3.8/urllib/request.py", line 569, in error
    return self._call_chain(*args)
  File "/net/papilio/storage6/longfei/anaconda3/envs/nedo-fewshot/lib/python3.8/urllib/request.py", line 502, in _call_chain
    result = func(*args)
  File "/net/papilio/storage6/longfei/anaconda3/envs/nedo-fewshot/lib/python3.8/urllib/request.py", line 649, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 403: Forbidden
/net/papilio/storage5/nedo-otsl/longfei/patchcore-few-shot/src/anomalib/config/config.py:304: UserWarning: The seed value is now fixed to 0. Up to v0.3.7, the seed was not fixed when the seed value was set to 0. If you want to use the random seed, please select `None` for the seed value (`null` in the YAML file) or remove the `seed` key from the YAML file.
  warn(
Global seed set to 0
2024-01-17 01:48:34,202 - anomalib - INFO - Doing category: bottle
2024-01-17 01:48:34,203 - anomalib.data - INFO - Loading the datamodule
2024-01-17 01:48:34,203 - anomalib.data.utils.transform - INFO - No config file has been provided. Using default transforms.
2024-01-17 01:48:34,203 - anomalib.data.utils.transform - INFO - No config file has been provided. Using default transforms.
2024-01-17 01:48:34,203 - anomalib.data.mvtec - INFO - Found the dataset.
2024-01-17 01:48:34,253 - anomalib - INFO - Training on 1 examples
2024-01-17 01:48:34,253 - anomalib - INFO -                     path  split  ... label_index mask_path
0  datasets/mvtec/bottle  train  ...           0

[1 rows x 6 columns]
2024-01-17 01:48:34,259 - anomalib.models - INFO - Loading the model.
2024-01-17 01:48:34,260 - anomalib.models.components.base.anomaly_module - INFO - Initializing PatchcoreLightning model.
/net/papilio/storage6/longfei/anaconda3/envs/nedo-fewshot/lib/python3.8/site-packages/torchmetrics/utilities/prints.py:36: UserWarning: Metric `PrecisionRecallCurve` will save all targets and predictions in buffer. For large datasets this may lead to large memory footprint.
  warnings.warn(*args, **kwargs)
Downloading: "https://antialiased-cnns.s3.us-east-2.amazonaws.com/weights_v0.1/wide_resnet50_2_lpf4_finetune-02a183f7.pth" to /home/tslab/longfei/.cache/torch/hub/checkpoints/wide_resnet50_2_lpf4_finetune-02a183f7.pth
[16, 4, 4, 1, 1]
[None, None, None, None, None]



k-shot: 1
run: 0
category: bottle



Loading model antialiased_wide_resnet50_2 from antialias_cnn
Traceback (most recent call last):
  File "scripts/few_shot_training.py", line 304, in <module>
    train()
  File "scripts/few_shot_training.py", line 284, in train
    train_step(
  File "scripts/few_shot_training.py", line 91, in train_step
    model = get_model(config)
  File "/net/papilio/storage5/nedo-otsl/longfei/patchcore-few-shot/src/anomalib/models/__init__.py", line 65, in get_model
    model = getattr(module, f"{_snake_to_pascal_case(config.model.name)}Lightning")(config)
  File "/net/papilio/storage5/nedo-otsl/longfei/patchcore-few-shot/src/anomalib/models/patchcore/lightning_model.py", line 131, in __init__
    super().__init__(
  File "/net/papilio/storage5/nedo-otsl/longfei/patchcore-few-shot/src/anomalib/models/patchcore/lightning_model.py", line 49, in __init__
    self.model: PatchcoreModel = PatchcoreModel(
  File "/net/papilio/storage5/nedo-otsl/longfei/patchcore-few-shot/src/anomalib/models/patchcore/torch_model.py", line 62, in __init__
    model = antialiased_cnns.wide_resnet50_2(pretrained=True)
  File "/net/papilio/storage6/longfei/anaconda3/envs/nedo-fewshot/lib/python3.8/site-packages/antialiased_cnns/resnet.py", line 406, in wide_resnet50_2
    model.load_state_dict(model_zoo.load_url(model_urls['wide_resnet50_2_lpf4_finetune'], map_location='cpu', check_hash=True)['state_dict'])
  File "/net/papilio/storage6/longfei/anaconda3/envs/nedo-fewshot/lib/python3.8/site-packages/torch/hub.py", line 766, in load_state_dict_from_url
    download_url_to_file(url, cached_file, hash_prefix, progress=progress)
  File "/net/papilio/storage6/longfei/anaconda3/envs/nedo-fewshot/lib/python3.8/site-packages/torch/hub.py", line 620, in download_url_to_file
    u = urlopen(req)
  File "/net/papilio/storage6/longfei/anaconda3/envs/nedo-fewshot/lib/python3.8/urllib/request.py", line 222, in urlopen
    return opener.open(url, data, timeout)
  File "/net/papilio/storage6/longfei/anaconda3/envs/nedo-fewshot/lib/python3.8/urllib/request.py", line 531, in open
    response = meth(req, response)
  File "/net/papilio/storage6/longfei/anaconda3/envs/nedo-fewshot/lib/python3.8/urllib/request.py", line 640, in http_response
    response = self.parent.error(
  File "/net/papilio/storage6/longfei/anaconda3/envs/nedo-fewshot/lib/python3.8/urllib/request.py", line 569, in error
    return self._call_chain(*args)
  File "/net/papilio/storage6/longfei/anaconda3/envs/nedo-fewshot/lib/python3.8/urllib/request.py", line 502, in _call_chain
    result = func(*args)
  File "/net/papilio/storage6/longfei/anaconda3/envs/nedo-fewshot/lib/python3.8/urllib/request.py", line 649, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 403: Forbidden
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant