Closed mabuyun closed 1 year ago
同样错误,替换成mmcv 2.0.0会报ImportError: cannot import name 'Config' from 'mmcv错误
确认一下安装的是不是:mmcv-full 或者尝试 pip install mmcv-full
使用官方的conda安装方式可以,不要自己装torch,tensorflow
使用官方的conda安装方式可以,不要自己装torch,tensorflow
@mabuyun please try this.
并没有解决 尝试了把 torch按照官方重装好几遍,并且 mmcv-full 的 mim 和 pip 安装方式都试了(2个包都安装 or 单独安装其中一个,各类组合也都试了),都无法解决(要么卡在: 'Config' from 'mmcv,要么卡在 MMCV==1.7.0 is used but incompatible )
请问一下应该怎么解决呢?这个问题我看还蛮多人问的,最后都指向这里,但是好像还是没完全close,求大佬有空可以帮忙检查一下
刚才帮人装了一个windows环境, 用的的mmcv-full, 1.7.1. 需要安装好msvc环境.使用没有问题
反正我没解决,可能因为我用的不是windows吧。。。
@mabuyun @JackAILab @levylll 我也遇到了这种情况。最后我不指定版本安装mim install mmcv-full
,然后默认安装的版本是1.7.2,成功了。不过需要注意,这个过程你需要先完全清理干净mmcv包。
mim install mmcv-full
@mabuyun @JackAILab @levylll 我也遇到了这种情况。最后我不指定版本安装
mim install mmcv-full
,然后默认安装的版本是1.7.2,成功了。不过需要注意,这个过程你需要先完全清理干净mmcv包。
分享一下你的环境
按照文档安装依赖后,在点击训练时程序报错如下,请问这是什么问题,应该如何解决
完整日志
``` --------uuid: qw ----------work_dir: /tmp/qw/ly261666/cv_portrait_model/test 2023-09-06 09:43:47,216 - modelscope - INFO - Use user-specified model revision: v1.0.0 2023-09-06 09:43:50,614 - modelscope - INFO - PyTorch version 2.0.1 Found. 2023-09-06 09:43:50,616 - modelscope - INFO - Loading ast index from /root/.cache/modelscope/ast_indexer 2023-09-06 09:43:50,643 - modelscope - INFO - Loading done! Current index file version is 1.8.4, with md5 60f12092040db79768c47d25ddfef07d and a total number of 902 components indexed /data/facechain/app.py:659: GradioDeprecationWarning: The `style` method is deprecated. Please set these arguments in the constructor instead. output_images = gr.Gallery(label='Output', show_label=False).style(columns=3, rows=2, height=600, /data/facechain/app.py:706: GradioDeprecationWarning: The `style` method is deprecated. Please set these arguments in the constructor instead. gallery = gr.Gallery(template_gallery_list).style(grid=4, height=300) /data//facechain/app.py:706: GradioDeprecationWarning: The 'grid' parameter will be deprecated. Please use 'columns' in the constructor instead. gallery = gr.Gallery(template_gallery_list).style(grid=4, height=300) /data/facechain/app.py:757: GradioDeprecationWarning: The `style` method is deprecated. Please set these arguments in the constructor instead. output_images = gr.Gallery( 2023-09-06 09:43:54,041 - modelscope - INFO - Use user-specified model revision: v4.0 2023-09-06 09:44:00,212 - modelscope - INFO - Use user-specified model revision: v1.0.1 2023-09-06 09:44:00,517 - modelscope - WARNING - ('PIPELINES', 'skin-retouching-torch', 'skin-retouching-torch') not found in ast index file 2023-09-06 09:44:00,517 - modelscope - INFO - initiate model from /root/.cache/modelscope/hub/damo/cv_unet_skin_retouching_torch 2023-09-06 09:44:00,517 - modelscope - INFO - initiate model from location /root/.cache/modelscope/hub/damo/cv_unet_skin_retouching_torch. 2023-09-06 09:44:00,520 - modelscope - WARNING - No preprocessor field found in cfg. 2023-09-06 09:44:00,521 - modelscope - WARNING - No val key and type key found in preprocessor domain of configuration.json file. 2023-09-06 09:44:00,521 - modelscope - WARNING - Cannot find available config to build preprocessor at mode inference, current config: {'model_dir': '/root/.cache/modelscope/hub/damo/cv_unet_skin_retouching_torch'}. trying to build by task and model information. 2023-09-06 09:44:00,521 - modelscope - WARNING - Find task: skin-retouching-torch, model type: None. Insufficient information to build preprocessor, skip building preprocessor 2023-09-06 09:44:03,611 - modelscope - INFO - Model revision not specified, use the latest revision: v2.0.2 2023-09-06 09:44:05,202 - modelscope - INFO - initiate model from /root/.cache/modelscope/hub/damo/cv_resnet50_face-detection_retinaface 2023-09-06 09:44:05,202 - modelscope - INFO - initiate model from location /root/.cache/modelscope/hub/damo/cv_resnet50_face-detection_retinaface. 2023-09-06 09:44:05,204 - modelscope - WARNING - No preprocessor field found in cfg. 2023-09-06 09:44:05,204 - modelscope - WARNING - No val key and type key found in preprocessor domain of configuration.json file. 2023-09-06 09:44:05,204 - modelscope - WARNING - Cannot find available config to build preprocessor at mode inference, current config: {'model_dir': '/root/.cache/modelscope/hub/damo/cv_resnet50_face-detection_retinaface'}. trying to build by task and model information. 2023-09-06 09:44:05,204 - modelscope - WARNING - Find task: face-detection, model type: None. Insufficient information to build preprocessor, skip building preprocessor 2023-09-06 09:44:05,204 - modelscope - INFO - loading model from /root/.cache/modelscope/hub/damo/cv_resnet50_face-detection_retinaface/pytorch_model.pt 2023-09-06 09:44:10,313 - modelscope - INFO - load model done 2023-09-06 09:44:21.944507445 [W:onnxruntime:, graph.cc:3543 CleanUnusedInitializersAndNodeArgs] Removing initializer 'const_fold_opt__2649'. It is not used by any node and should be removed from the model. 2023-09-06 09:44:21.944545347 [W:onnxruntime:, graph.cc:3543 CleanUnusedInitializersAndNodeArgs] Removing initializer 'const_fold_opt__2657'. It is not used by any node and should be removed from the model. 2023-09-06 09:44:21.944553834 [W:onnxruntime:, graph.cc:3543 CleanUnusedInitializersAndNodeArgs] Removing initializer 'const_fold_opt__2644'. It is not used by any node and should be removed from the model. 2023-09-06 09:44:21.944558189 [W:onnxruntime:, graph.cc:3543 CleanUnusedInitializersAndNodeArgs] Removing initializer 'const_fold_opt__2594'. It is not used by any node and should be removed from the model. 2023-09-06 09:44:21.944564672 [W:onnxruntime:, graph.cc:3543 CleanUnusedInitializersAndNodeArgs] Removing initializer 'const_fold_opt__2596'. It is not used by any node and should be removed from the model. 2023-09-06 09:44:21.944576104 [W:onnxruntime:, graph.cc:3543 CleanUnusedInitializersAndNodeArgs] Removing initializer 'const_fold_opt__2653'. It is not used by any node and should be removed from the model. 2023-09-06 09:44:21.944582454 [W:onnxruntime:, graph.cc:3543 CleanUnusedInitializersAndNodeArgs] Removing initializer 'const_fold_opt__2624'. It is not used by any node and should be removed from the model. 2023-09-06 09:44:21.944589144 [W:onnxruntime:, graph.cc:3543 CleanUnusedInitializersAndNodeArgs] Removing initializer 'const_fold_opt__2652'. It is not used by any node and should be removed from the model. 2023-09-06 09:44:21.944598536 [W:onnxruntime:, graph.cc:3543 CleanUnusedInitializersAndNodeArgs] Removing initializer 'const_fold_opt__2645'. It is not used by any node and should be removed from the model. 2023-09-06 09:44:21.944604855 [W:onnxruntime:, graph.cc:3543 CleanUnusedInitializersAndNodeArgs] Removing initializer 'const_fold_opt__2643'. It is not used by any node and should be removed from the model. 2023-09-06 09:44:21.944611875 [W:onnxruntime:, graph.cc:3543 CleanUnusedInitializersAndNodeArgs] Removing initializer 'const_fold_opt__2648'. It is not used by any node and should be removed from the model. 2023-09-06 09:44:21.944618333 [W:onnxruntime:, graph.cc:3543 CleanUnusedInitializersAndNodeArgs] Removing initializer 'const_fold_opt__2647'. It is not used by any node and should be removed from the model. 2023-09-06 09:44:21.944625053 [W:onnxruntime:, graph.cc:3543 CleanUnusedInitializersAndNodeArgs] Removing initializer 'const_fold_opt__2641'. It is not used by any node and should be removed from the model. 2023-09-06 09:44:21.944631851 [W:onnxruntime:, graph.cc:3543 CleanUnusedInitializersAndNodeArgs] Removing initializer 'const_fold_opt__2633'. It is not used by any node and should be removed from the model. 2023-09-06 09:44:21.944637973 [W:onnxruntime:, graph.cc:3543 CleanUnusedInitializersAndNodeArgs] Removing initializer 'const_fold_opt__2632'. It is not used by any node and should be removed from the model. 2023-09-06 09:44:21.944644209 [W:onnxruntime:, graph.cc:3543 CleanUnusedInitializersAndNodeArgs] Removing initializer 'const_fold_opt__2614'. It is not used by any node and should be removed from the model. 2023-09-06 09:44:21.944650581 [W:onnxruntime:, graph.cc:3543 CleanUnusedInitializersAndNodeArgs] Removing initializer 'const_fold_opt__2613'. It is not used by any node and should be removed from the model. 2023-09-06 09:44:21.944656695 [W:onnxruntime:, graph.cc:3543 CleanUnusedInitializersAndNodeArgs] Removing initializer 'const_fold_opt__2658'. It is not used by any node and should be removed from the model. 2023-09-06 09:44:21.944663407 [W:onnxruntime:, graph.cc:3543 CleanUnusedInitializersAndNodeArgs] Removing initializer 'const_fold_opt__2606'. It is not used by any node and should be removed from the model. 2023-09-06 09:44:21.944669742 [W:onnxruntime:, graph.cc:3543 CleanUnusedInitializersAndNodeArgs] Removing initializer 'const_fold_opt__2598'. It is not used by any node and should be removed from the model. 2023-09-06 09:44:22,550 - modelscope - INFO - Use user-specified model revision: v1.1 2023-09-06 09:44:22,736 - modelscope - INFO - initiate model from /root/.cache/modelscope/hub/damo/cv_ddsar_face-detection_iclr23-damofd 2023-09-06 09:44:22,736 - modelscope - INFO - initiate model from location /root/.cache/modelscope/hub/damo/cv_ddsar_face-detection_iclr23-damofd. 2023-09-06 09:44:22,737 - modelscope - INFO - initialize model from /root/.cache/modelscope/hub/damo/cv_ddsar_face-detection_iclr23-damofd Process Process-1: Traceback (most recent call last): File "/root/miniconda3/envs/facechain/lib/python3.8/site-packages/modelscope/utils/registry.py", line 210, in build_from_cfg return obj_cls._instantiate(**args) File "/root/miniconda3/envs/facechain/lib/python3.8/site-packages/modelscope/models/base/base_model.py", line 66, in _instantiate return cls(**kwargs) File "/root/miniconda3/envs/facechain/lib/python3.8/site-packages/modelscope/models/cv/face_detection/scrfd/damofd_detect.py", line 31, in __init__ super().__init__(model_dir, **kwargs) File "/root/miniconda3/envs/facechain/lib/python3.8/site-packages/modelscope/models/cv/face_detection/scrfd/scrfd_detect.py", line 36, in __init__ from mmdet.models import build_detector File "/root/miniconda3/envs/facechain/lib/python3.8/site-packages/mmdet/__init__.py", line 16, in