-
Notifications
You must be signed in to change notification settings - Fork 240
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
cannot import name 'BertConfig' from 'custom_mesh_graphormer.modeling.bert.modeling_bert' #502
Comments
i also have this error in MeshGraphormer Hand Refiner for the versions: 1.0.5 [nightly] |
Same here |
error: cannot import name 'BertConfig' from 'custom_mesh_graphormer.modeling.bert.modeling_bert' I have fix the issue; /ssdDir/comfyui/ComfyUI/custom_nodes/comfyui_controlnet_aux/src/custom_mesh_graphormer/modeling/bert/init.py 修改 init.py 文件,添加包绝对引入路径comfyui, the dependency package of the plug-in cannot be found /ssdDir/comfyui/ComfyUI/custom_nodes/comfyui_controlnet_aux/src/custom_mesh_graphormer/modeling/bert/init.py ====================================================================== from modeling_bert import (BertConfig, BertModel, from modeling_graphormer import Graphormer from e2e_body_network import Graphormer_Body_Network from e2e_hand_network import Graphormer_Hand_Network CONFIG_NAME = "config.json" from modeling_utils import (WEIGHTS_NAME, TF_WEIGHTS_NAME, from file_utils import (PYTORCH_PRETRAINED_BERT_CACHE) |
It looks like version 4.48 of the python library transformers removed the BertConfig class. |
works, thanks |
hey in which folder should I run this cmd |
Thanks for helping |
If you are copying someone else's workflow and the problem arises, I have found a good way to simply delete the problematic node and enter it again manually |
why close? you are not supposed to update the node instead of us downgrading the transform? |
I didn't quite sure whether it is issue of aux team @staltux But I think you are right, let me reopen it |
There's nothing to do with the path of model, it's because huggingface's transfermers 0.48.0 move the BertConfig to a new file called configuration_bert, try this patch to fix it. And even it can run with this patch and download the pth model from huggingface, but you still need downgrade mediapipe module to avoid this problem(https://stackoverflow.com/questions/78493742/feedback-manager-requires-a-model-with-a-single-signature-inference). And most crappy thing is after all of this you will found this node output nothing but a black image, it's totally wasted. diff --git a/src/custom_mesh_graphormer/modeling/bert/init.py b/src/custom_mesh_graphormer/modeling/bert/init.py -from .modeling_bert import (BertConfig, BertModel, from .modeling_graphormer import Graphormer 有空修修吧,挺好的node为啥不维护了呢? |
modify custom_nodes/comfyui_controlnet_aux/src/custom_mesh_graphormer/modeling/bert/modeling_bert.py finally code: # from transformers.models.bert.modeling_bert import *
from transformers.models.bert import modeling_bert
for symbol in dir(modeling_bert):
if not symbol.startswith("_"):
globals()[symbol] = getattr(modeling_bert, symbol) restart comfyui |
bro,you are HERO!!!!! |
The file in the specified folder is called_init_.py for me.. |
I was tormented with this problem for 2 days. None of the options described above helped to solve the problem completely. In the end I came to this solution:
I have not tried other versions of mediapipe, I installed the oldest one available.
|
I would like to ask about numbers 1 and 2. Regarding number 2, is it okay to use the following URL for the installation destination ? However, I think I installed ComfyUI from the URL above in the past, but I can't find the folder called python_embedded. I am using the translation function. I apologize if my English is difficult to understand. |
ok, well Done |
I downgraded the transformers and mediapipe, now I'm getting a different error: No module named 'custom_mesh_graphormer.pipeline' |
Can you be more specific? What did you use and what was your working environment like? If it only reports the error No module named 'custom_mesh_graphormer.pipeline', you can try to open the py file with the error in the comfyui terminal, find the line number of the error based on it, and then modify it (if the error is caused by the introduction of a module of transformers, it may be a module path problem) |
Specific Environment & Setup Used: Error Encountered: Stack Trace Snippet: |
i not have custom_mesh_graphormer_init_.py you can try upgrade “comfyui_controlnet_aux”
|
I did git reset and pull, still same issue. How else can I upgrade? |
C:\Users\user\ComfyUI\custom_nodes\comfyui_controlnet_aux\src\custom_mesh_graphormer__init__.py is your old error. To be precise, in the latest comfyui_controlnet_aux version, there is no custom_mesh_graphormer__init__.py, only init.py and there is no content in it. If you still have an error in the custom_mesh_graphormer__init__.py file, then you may not have updated successfully. Maybe you can download it manually: https://github.com/Fannovel16/comfyui_controlnet_aux/tree/main And my mediapipe version is 0.10.20 |
Final attempt: I went into the__init__.py folder and removed the text so that the file is empty. I now get a different error when I reload Comfy, as shown in the image. Since this is not working and unless anyone knows a fix without uninstalling, should I uninstall the node completely or change versions? I don't really want to do that since my workflow has a few nodes using controlnet_aux. Will uninstall and reinstalling it effect or ruin my current nodes or will everything reapply normally when reinstalled? Also will I have to do the transformers + mediapipe fixes again once reinstalled? Thanks |
you can reinstall controlnet_aux,
You can completely uninstall (delete) controlnet_aux (if there are models in it, you can back it up in advance and put it back in after reinstalling) and reinstall it. I just started making my own comfyui integration package in the past month, which solved many problems and node upgrades. You should upgrade your nodes in time (unless you are using an old comfyui, I suggest you reinstall it). Because this is the only way to adapt to the latest features and various gameplay. And I have also studied many workflows, some of which are old and use old nodes (corresponding to the class name or method name in the python code). If you know which one this node uses to replace, you can also manually replace it, or modify this workflow, so I also recommend using the new version of the workflow. In addition, can you tell me your workflow? I am not sure if you are using the hand fix version of MeshGraphommer-DepthMapPreprocessor。 |
Original Code (Incorrect): from transformers.models.bert import modeling_bert for symbol in dir(modeling_bert): Fixed Code (Correct Indentation): from transformers.models.bert import modeling_bert for symbol in dir(modeling_bert): Explanation: The if and globals() lines must be indented to show they belong to the for loop block. How to Fix: Add 4 spaces before if not symbol.startswith("_"). Add 8 spaces (or a second level of indentation) before globals()[symbol].... Save the file and restart ComfyUI. Verify the init.py File: |
ComfyUI Error ReportError Details
Stack Trace
System Information
Devices
Logs
Attached WorkflowPlease make sure that workflow does not contain any sensitive information such as API keys or passwords.
Additional Context(Please add any additional context or steps to reproduce the error here) |
i'm having the same problem here, this is the error that i get: ` Prompt executed in 0.92 seconds i'm running the last comfyui-zluda, with these parameters: ` Prestartup times for custom nodes: Warning, you are using an old pytorch version and some ckpt/pt files might be loaded unsafely. Upgrading to 2.4 or above is recommended. ----------------------ZLUDA----------------------------- Total VRAM 16368 MB, total RAM 16306 MB Loading: ComfyUI-Impact-Pack (V8.8.1)[Impact Pack] Wildcards loading done. Loading: ComfyUI-Impact-Subpack (V1.2.9)[Impact Subpack] ultralytics_bbox: F:\ai\ComfyUI-Zluda\models\ultralytics\bbox Loading: ComfyUI-Inspire-Pack (V1.13.1)jjk_util loding Loading: ComfyUI-Manager (V3.17.10)ComfyUI Revision: 3583 [6f05ace0] | Released on '2025-02-14'Openpose Editor Plus: Loaded MACHINE DELUSIONS Efficiency Nodes: Attempting to add Control Net options to the 'HiRes-Fix Script' Node (comfyui_controlnet_aux add-on)...Success! [rgthree-comfy] Loaded 42 extraordinary nodes. 🎉 Import times for custom nodes: please help here! |
I have not even touched anything and suddenly got that error and cant even fix it not even with solutions in here |
same issue, is this project dead? |
Solution is here #502 (comment) |
I have the same problem here, I try everything that is written here so.. don't know;/ ComfyUI Error ReportError Details
Stack Trace
System Information
Devices
Logs
Attached WorkflowPlease make sure that workflow does not contain any sensitive information such as API keys or passwords.
Additional Context(Please add any additional context or steps to reproduce the error here) |
Please help
I got this for both MeshGraphormer-DepthMapPreprocessor and MeshGraphormer+ImpactDetector-DepthMapPreprocessor
Also I tried to update with pip install --user --editable .
And did the install.bat again
ComfyUI Error Report
Error Details
Stack Trace
The text was updated successfully, but these errors were encountered: