fiveai / MoCaE

The official implementation of "MoCaE: Mixture of Calibrated Experts Significantly Improves Accuracy in Object Detection"
https://arxiv.org/abs/2309.14976
Other
21 stars 3 forks source link

ImportError: cannot import name 'nn_calibrator' from 'analysis_tools.model_calibration' #5

Closed sakure1 closed 1 month ago

sakure1 commented 2 months ago

Hello,

I'm encountering an issue while trying to run train_calibrator.py. The script throws the following error:

javascript

File "tools/train_calibrator.py", line 23, in from analysis_tools.model_calibration import nn_calibrator ImportError: cannot import name 'nn_calibrator' from 'analysis_tools.model_calibration' (/MoCaE/tools/analysis_tools/model_calibration.py)

It seems like the module nn_calibrator cannot be imported from analysis_tools.model_calibration. I've checked the model_calibration.py file, and it doesn't seem to contain the nn_calibrator function/class, or there may be some other issue.

Steps to Reproduce:

Clone the repository.
Run the train_calibrator.py script.
Observe the error.

Expected Behavior: The script should run without import errors and should correctly locate the nn_calibrator.

Environment:

OS: Ubuntu 20.04
Python version: Python 3.8

Additional Information: Any help or guidance on resolving this issue would be appreciated. Let me know if further details are needed.

Thank you!

kemaloksuz commented 2 months ago

Hi, to obtain the calibrator you should follow here, which states

python tools/analysis_tools/model_calibration.py model_name

as the command to train the calibrators. The script that you are using was intended for a different purpose that we didn't use in the final version of MoCaE, so please feel free to ignore tools/train_calibrator.py script.

sakure1 commented 2 months ago

Hi, kemaloksuz Thanks a lot for getting back to me and clearing that up! I’ll go ahead and use the model_calibration.py script as you suggested. Appreciate the help and all the hard work on this awesome project!