-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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
ImportError: Failed to import projects.<MODEL_NAME>.<model> #11082
Comments
@achariso This operation is not supported under the project. You need to prepare the configuration and weights. |
@hhaAndroid can you please elaborate? |
@Jordan-Pierce I could solve the above error , by adding path to mmdetection to python path or through sys.path.append(path_to_mmedetection_dir) |
Adding to @LokeshJatangi 's solution, one has to modify the config imports as well. |
#11913 provides a simple fix to this. |
I've had the same issue, but with different causes. 1.) I had another library installed, which also had a module "projects" in it. The import logic in MMEngine imported from that library instead. 2.) For me, MMDet also needed to be installed in "editable" (pip install . -e) mode to use projects.
For me, the import logic of mmengine in the context of using "projects" is not robust. |
I cannot instantiate a custom model, Co-DETR given the weights.
After searching, it seems that there is a package named "projects" which prevents python from searching into the
mmdetection
directory (it is in the PYTHONPATH).My env is a docker image (
thanosch/mmtorch:2.1.0-cuda121
) with Python 3.10 and the latest version of mm:The text was updated successfully, but these errors were encountered: