RuntimeError: #959
Unanswered
kikyostudypython
asked this question in
Q&A
Replies: 1 comment
-
I had the same error. I solved it by downgrading my python version from 3.10 to 3.9, maybe this helps? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, I tried to train the program, but I met a mistake, I can not go to solve it, someone can help me, thank you very much。
2023-03-15 15:19:13,897 - anomalib.models - INFO - Loading the model.
2023-03-15 15:19:13,898 - anomalib.models.components.base.anomaly_module - INFO - Initializing PadimLightning model.
E:\AnacondaInstall\envs\anomalib_env\lib\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)
2023-03-15 15:19:13,903 - anomalib.models.components.feature_extractors.timm - WARNING - FeatureExtractor is deprecated. Use TimmFeatureExtractor instead. Both FeatureExtractor and TimmFeatureExtractor will be removed in a future relea
se.
2023-03-15 15:19:14,130 - timm.models.helpers - INFO - Loading pretrained weights from url (https://download.pytorch.org/models/resnet18-5c106cde.pth)
Traceback (most recent call last):
File "tools/train.py", line 79, in
train()
File "tools/train.py", line 56, in train
model = get_model(config)
File "D:\Project\anomalib-main\anomalib\models_init_.py", line 100, in get_model
model = getattr(module, f"{_snake_to_pascal_case(config.model.name)}Lightning")(config)
File "D:\Project\anomalib-main\anomalib\models\padim\lightning_model.py", line 123, in init
super().init(
File "D:\Project\anomalib-main\anomalib\models\padim\lightning_model.py", line 49, in init
self.model: PadimModel = PadimModel(
File "D:\Project\anomalib-main\anomalib\models\padim\torch_model.py", line 99, in init
self.anomaly_map_generator = AnomalyMapGenerator(image_size=input_size)
File "D:\Project\anomalib-main\anomalib\models\padim\anomaly_map.py", line 28, in init
self.blur = GaussianBlur2d(kernel_size=(kernel_size, kernel_size), sigma=(sigma, sigma), channels=1)
File "D:\Project\anomalib-main\anomalib\models\components\filters\blur.py", line 66, in init
self.kernel = self.kernel.expand(self.channels, -1, -1, -1)
RuntimeError: expand(torch.FloatTensor{[1, 1, 1, 33, 33]}, size=[1, -1, -1, -1]): the number of sizes provided (4) must be greater or equal to the number of dimensions in the tensor (5)
Beta Was this translation helpful? Give feedback.
All reactions