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

ValueError: MyCustomPipeline: Module class already registered: TrainFeed #603

Closed
Tramac opened this issue Oct 27, 2023 · 5 comments
Closed
Assignees
Labels

Comments

@Tramac
Copy link

Tramac commented Oct 27, 2023

Thanks for your error report and we appreciate it a lot.

Checklist

  • I have searched the tutorial on modelscope doc-site
  • I have searched related issues but cannot get the expected help.
  • The bug has not been fixed in the latest version.

Describe the bug
使用【人脸检测&五官定位模型

出现以下报错:

2023-10-27 14:46:00,547 - modelscope - INFO - PyTorch version 2.0.1+cu118 Found.                                                                                                                            
2023-10-27 14:46:00,553 - modelscope - INFO - TensorFlow version 2.13.0 Found.                                                                                                                              
2023-10-27 14:46:00,553 - modelscope - INFO - Loading ast index from /home/xxx/.cache/modelscope/ast_indexer                                                                                      
2023-10-27 14:46:00,938 - modelscope - INFO - No valid ast index found from /home/xxx/.cache/modelscope/ast_indexer, generating ast index from prebuilt!                                          
2023-10-27 14:46:01,512 - modelscope - INFO - Loading done! Current index file version is 1.9.3, with md5 a93e2c6be4dabf3182e4282cfc96b8cb and a total number of 943 components indexed                     
2023-10-27 14:46:14,581 - modelscope - INFO - Use user-specified model revision: v1.0.2                                                                                                                     
2023-10-27 14:46:16,539 - modelscope - WARNING - ('PIPELINES', 'face_det_lmk', 'my-custom-pipeline') not found in ast index file                                                                            
2023-10-27 14:46:16,539 - modelscope - INFO - initiate model from /home/xxx/.cache/modelscope/hub/damo/cv_face_detection_landmark                                                                 
2023-10-27 14:46:16,539 - modelscope - INFO - initiate model from location /home/xxx/.cache/modelscope/hub/damo/cv_face_detection_landmark.                                                       
2023-10-27 14:46:16,543 - modelscope - WARNING - No preprocessor field found in cfg.                                                                                                                        
2023-10-27 14:46:16,543 - modelscope - WARNING - No val key and type key found in preprocessor domain of configuration.json file.                                                                           
2023-10-27 14:46:16,543 - modelscope - WARNING - Cannot find available config to build preprocessor at mode inference, current config: {'model_dir': '/home/xxx/.cache/modelscope/hub/damo/cv_face
_detection_landmark'}. trying to build by task and model information.                                                                                                                                       
2023-10-27 14:46:16,543 - modelscope - WARNING - Find task: face_qua, model type: None. Insufficient information to build preprocessor, skip building preprocessor                                          
2023-10-27 14:46:17,463 - modelscope - INFO - Use user-specified model revision: v2.0.5                                                                                                                     
Traceback (most recent call last):                                                                                                                                                                          
  File "/python3.10/site-packages/modelscope/utils/registry.py", line 212, in build_from_cfg                                                                                
    return obj_cls(**args)                                                                                                                                                                                  
  File "/home/xxx/.cache/modelscope/modelscope_modules/cv_face_detection_landmark/ms_wrapper.py", line 58, in __init__
    self.det_func = pipeline('face_detection_repo', model='damo/face_detection_model', model_revision='v2.0.5')
  File "/python3.10/site-packages/modelscope/pipelines/builder.py", line 137, in pipeline
    register_modelhub_repo(model, cfg.get('allow_remote', False))
  File "/python3.10/site-packages/modelscope/utils/plugins.py", line 455, in register_modelhub_repo
    import_module_from_model_dir(model_dir)
  File "/python3.10/site-packages/modelscope/utils/plugins.py", line 400, in import_module_from_model_dir
    importlib.import_module(submodule)
  File "/python3.10/importlib/__init__.py", line 126, in import_module 
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 992, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 992, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/home/xxx/.cache/modelscope/modelscope_modules/face_detection_model/data/__init__.py", line 3, in <module>
    from . import data_feed
  File "/home/xxx/.cache/modelscope/modelscope_modules/face_detection_model/data/data_feed.py", line 20, in <module>
    class TrainFeed(data.Dataset):
  File "/home/xxx/.cache/modelscope/modelscope_modules/face_detection_model/core/workspace.py", line 138, in register
    raise ValueError("Module class already registered: {}".format(
ValueError: Module class already registered: TrainFeed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "test.py", line 6, in <module>
    inference = pipeline('face_det_lmk', model='damo/cv_face_detection_landmark', model_revision='v1.0.2')
  File "/python3.10/site-packages/modelscope/pipelines/builder.py", line 163, in pipeline
    return build_pipeline(cfg, task_name=task)
  File "/python3.10/site-packages/modelscope/pipelines/builder.py", line 67, in build_pipeline
    return build_from_cfg(
  File "/python3.10/site-packages/modelscope/utils/registry.py", line 215, in build_from_cfg
    raise type(e)(f'{obj_cls.__name__}: {e}')
ValueError: MyCustomPipeline: Module class already registered: TrainFeed

To Reproduce

  • What command or script did you run?
from modelscope.models import Model
from modelscope.pipelines import pipeline
input = "https://modelscope.oss-cn-beijing.aliyuncs.com/test/images/mog_face_detection.jpg"
inference = pipeline('face_det_lmk', model='damo/cv_face_detection_landmark', model_revision='v1.0.2')
output = inference(input)
print(output.keys())

Your Environments (required)

  • OS: Ubuntu
  • CPU:
  • Commit id : modelscope == 1.9.3

Pipeline related: @Firmament-cyou @wenmengzhou

@wenmengzhou
Copy link
Collaborator

你好,相关问题已经反馈给对应同学,请等待回复

@wenmengzhou
Copy link
Collaborator

问题已修复,请重试

@xiuxiuxius
Copy link

你好,又有了新的问题

modelscope 1.14.0

image

问题已修复,请重试

Copy link

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the Stale label Jun 24, 2024
Copy link

This issue was closed because it has been stalled for 5 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jun 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants