PaddleX icon indicating copy to clipboard operation
PaddleX copied to clipboard

按照案例使用STFPM报错,提示没有注册这个模块

Open alanzheng800 opened this issue 1 year ago • 7 comments

描述问题

按照案例使用STFPM报错,提示没有注册这个模块

复现

  1. 您是否已经正常运行我们提供的教程? ??

  2. 您是否在教程的基础上修改代码内容?还请您提供运行的代码 还没有修改代码

  3. 您使用的数据集是? mvtec_examples

  4. 请提供您出现的报错信息及相关log (c:\conda\paddlex) PS D:\study\PaddleX-release-3.0> python main.py -c paddlex/configs/anomaly_detection/STFPM.yaml -o Global.mode=evaluate -o Global.dataset_dir=D:\datasets\mvtec_examples Traceback (most recent call last): File "D:\study\PaddleX-release-3.0\paddlex\repo_apis\base\config.py", line 30, in _create_config model_info = get_registered_model_info(model_name) File "D:\study\PaddleX-release-3.0\paddlex\repo_apis\base\register.py", line 78, in query return self._table[prim_key] KeyError: 'STFPM'

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "D:\study\PaddleX-release-3.0\paddlex\utils\result_saver.py", line 29, in wrap result = func(self, *args, **kwargs) File "D:\study\PaddleX-release-3.0\paddlex\engine.py", line 44, in run return self._model.evaluate() File "D:\study\PaddleX-release-3.0\paddlex\model.py", line 97, in evaluate evaluator = build_evaluater(self._config) File "D:\study\PaddleX-release-3.0\paddlex\modules\base\evaluator.py", line 36, in build_evaluater return BaseEvaluator.get(model_name)(config) File "D:\study\PaddleX-release-3.0\paddlex\modules\base\evaluator.py", line 56, in init self.pdx_config, self.pdx_model = build_model( File "D:\study\PaddleX-release-3.0\paddlex\modules\base\build_model.py", line 32, in build_model config = Config(model_name, config_path) File "D:\study\PaddleX-release-3.0\paddlex\repo_apis\base\config.py", line 32, in _create_config raise UnsupportedParamError( paddlex.utils.errors.others.UnsupportedParamError: 'STFPM' is not a registered model name.

环境

  1. 请提供您使用的PaddlePaddle和PaddleX的版本号 paddlepaddle-gpu 3.0.0b1 paddlex 3.0.0b1
  2. 请提供您使用的操作系统信息,如Linux/Windows/MacOS win11
  3. 请问您使用的Python版本是? python 3.10
  4. 请问您使用的CUDA/cuDNN的版本号是? 11.8 8.9

alanzheng800 avatar Nov 11 '24 08:11 alanzheng800

要先安装paddlex插件 paddlex --install PaddleSeg

alanzheng800 avatar Nov 11 '24 09:11 alanzheng800

请确认paddleseg插件已经正确安装~

Bobholamovic avatar Nov 11 '24 15:11 Bobholamovic

利用案例的图来做训练,出现以下信息是正常的吗

1/57 [..............................] - ETA: 3s - batch_cost: 0.0575 - reader cost: 0.0263 3/57 [>.............................] - ETA: 2s - batch_cost: 0.0385 - reader cost: 0.0088 5/57 [=>............................] - ETA: 1s - batch_cost: 0.0346 - reader cost: 0.0053 7/57 [==>...........................] - ETA: 1s - batch_cost: 0.0342 - reader cost: 0.0038 9/57 [===>..........................] - ETA: 1s - batch_cost: 0.0335 - reader cost: 0.0029 11/57 [====>.........................] - ETA: 1s - batch_cost: 0.0335 - reader cost: 0.0024 14/57 [======>.......................] - ETA: 1s - batch_cost: 0.0317 - reader cost: 0.0019 16/57 [=======>......................] - ETA: 1s - batch_cost: 0.0322 - reader cost: 0.0016 18/57 [========>.....................] - ETA: 1s - batch_cost: 0.0321 - reader cost: 0.0015 20/57 [=========>....................] - ETA: 1s - batch_cost: 0.0314 - reader cost: 0.0014 22/57 [==========>...................] - ETA: 1s - batch_cost: 0.0310 - reader cost: 0.0012 24/57 [===========>..................] - ETA: 1s - batch_cost: 0.0308 - reader cost: 0.0012 26/57 [============>.................] - ETA: 0s - batch_cost: 0.0307 - reader cost: 0.0011 29/57 [==============>...............] - ETA: 0s - batch_cost: 0.0301 - reader cost: 9.7342e-04 31/57 [===============>..............] - ETA: 0s - batch_cost: 0.0299 - reader cost: 9.1062e-04 33/57 [================>.............] - ETA: 0s - batch_cost: 0.0298 - reader cost: 8.5543e-04 35/57 [=================>............] - ETA: 0s - batch_cost: 0.0297 - reader cost: 8.0655e-04 37/57 [==================>...........] - ETA: 0s - batch_cost: 0.0298 - reader cost: 7.6295e-04 39/57 [===================>..........] - ETA: 0s - batch_cost: 0.0298 - reader cost: 7.2383e-04 41/57 [====================>.........] - ETA: 0s - batch_cost: 0.0297 - reader cost: 6.8852e-04 43/57 [=====================>........] - ETA: 0s - batch_cost: 0.0299 - reader cost: 6.5649e-04 45/57 [======================>.......] - ETA: 0s - batch_cost: 0.0298 - reader cost: 6.2732e-04 48/57 [========================>.....] - ETA: 0s - batch_cost: 0.0293 - reader cost: 6.4895e-04 50/57 [=========================>....] - ETA: 0s - batch_cost: 0.0292 - reader cost: 6.2299e-04 53/57 [==========================>...] - ETA: 0s - batch_cost: 0.0289 - reader cost: 6.2464e-04 55/57 [===========================>..] - ETA: 0s - batch_cost: 0.0288 - reader cost: 6.5503e-04 57/57 [==============================] - 2s 29ms/step - batch_cost: 0.0286 - reader cost: 9.2237e-04 [2024/11/12 08:15:38] INFO: [EVAL] #Images: 57 mIoU: 0.9102 Acc: 1.0000 Kappa: 0.0000 Dice: 0.9530 [2024/11/12 08:15:38] INFO: [EVAL] Class IoU: [0.9102] [2024/11/12 08:15:38] INFO: [EVAL] Class Precision: [1.] [2024/11/12 08:15:38] INFO: [EVAL] Class Recall: [0.9102] c:\conda\paddlex\lib\site-packages\paddle\jit\dy2static\program_translator.py:699: UserWarning: full_graph=False don't support input_spec arguments. It will not produce any effect. You can set full_graph=True, then you can assign input spec.

warnings.warn( [2024/11/12 08:15:39] INFO: The inference model is saved in D:\study\PaddleX-release-3.0\output\iter_500 [2024/11/12 08:15:39] INFO: Already save model info in D:\study\PaddleX-release-3.0\output\iter_500 c:\conda\paddlex\lib\site-packages\paddle\jit\dy2static\program_translator.py:699: UserWarning: full_graph=False don't support input_spec arguments. It will not produce any effect. You can set full_graph=True, then you can assign input spec.

warnings.warn( [2024/11/12 08:15:41] INFO: The inference model is saved in D:\study\PaddleX-release-3.0\output\best_model [2024/11/12 08:15:41] INFO: Already save model info in D:\study\PaddleX-release-3.0\output\best_model [2024/11/12 08:15:41] INFO: [EVAL] The model with the best validation mIoU (0.9102) was saved at iter 500. <class 'paddle.nn.layer.conv.Conv2D'>'s flops has been counted <class 'paddle.nn.layer.norm.BatchNorm2D'>'s flops has been counted <class 'paddle.nn.layer.activation.ReLU'>'s flops has been counted Cannot find suitable count function for <class 'paddle.nn.layer.pooling.MaxPool2D'>. Treat it as zero FLOPs. Total Flops: 4750442496 Total Params: 22372224

alanzheng800 avatar Nov 12 '24 00:11 alanzheng800

看起来是正常的呢

Bobholamovic avatar Nov 12 '24 03:11 Bobholamovic

配置文件中的tain.txt 中是什么样式呀? @alanzheng800 这不是只需要正样本么,难道也需要生成些0值的标签图像?

train_dataset: type: Dataset num_classes: 1 dataset_root: /mv_dataset/grid # You need to specify a specific category root in mvtec_ad dataset train_path: mv_dataset/grid/train.txt ...

Kaze816 avatar Nov 13 '24 05:11 Kaze816

使用的是官方案例的数据集,数据里面有正样,也有负样

---原始邮件--- 发件人: @.> 发送时间: 2024年11月13日(周三) 中午1:51 收件人: @.>; 抄送: @.@.>; 主题: Re: [PaddlePaddle/PaddleX] 按照案例使用STFPM报错,提示没有注册这个模块 (Issue #2455)

配置文件中的tain.txt 中是什么样式呀? @alanzheng800 这不是只需要正样本么,难道也需要生成些0值的标签图像?

train_dataset: type: Dataset num_classes: 1 dataset_root: /mv_dataset/grid # You need to specify a specific category root in mvtec_ad dataset train_path: mv_dataset/grid/train.txt ...

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

alanzheng800 avatar Nov 13 '24 08:11 alanzheng800

从日志看起来应该训练正常

Bobholamovic avatar Jun 05 '25 03:06 Bobholamovic

The issue has no response for a long time and will be closed. You can reopen or new another issue if are still confused.


From Bot

TingquanGao avatar Jul 06 '25 12:07 TingquanGao