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

TypeError: 'module' object is not callable #131

Closed
Darshcg opened this issue Jun 8, 2020 · 18 comments
Closed

TypeError: 'module' object is not callable #131

Darshcg opened this issue Jun 8, 2020 · 18 comments

Comments

@Darshcg
Copy link

Darshcg commented Jun 8, 2020

If I run: "python3 eval_yolov3.py --model yolov3-288" I am getting TypeError: 'module' object is not callable. Can you please help to resolve the same

@jkjung-avt
Copy link
Owner

This is too little information. Please provide the full error log (call trace).

@Darshcg
Copy link
Author

Darshcg commented Jun 8, 2020

image

@jkjung-avt
Copy link
Owner

You need to specify "--imgs_dir" and "--annotations" to point to the images and annotations of your own evaluation dataset. Note the annotations should be in "COCO" format.

https://github.com/jkjung-avt/tensorrt_demos/blob/master/eval_yolov3.py#L31

@Darshcg
Copy link
Author

Darshcg commented Jun 8, 2020

Actually I am using your Evaluation dataset(https://github.com/jkjung-avt/tensorrt_demos/blob/master/README_eval_ssd.md#preparation). Please help me what to change in line 31.

@jkjung-avt
Copy link
Owner

  1. Try sudo pip3 install progressbar2 and run "eval_yolov3.py" again, to see if the error is fixed.

  2. Otherwise, you could remove progressbar() from the code: https://github.com/jkjung-avt/tensorrt_demos/blob/master/eval_yolov3.py#L53. That is,

    Replace that line:

        for jpg in progressbar(jpgs):
    

    with:

        for jpg in jpgs:
    

@Darshcg
Copy link
Author

Darshcg commented Jun 8, 2020

@jkjung-avt, 1st didn't work, and I tried with 2nd, but it is taking so much of time to get the output. Is there any way to speed up(to get the output fast)?

@jkjung-avt
Copy link
Owner

The COCO "val2017" contains 5,000 images. It does take a while to do inference over all these images. If you don't want to evaluate the model with so many images, you could just delete some jpg files from the "val2017" folder.

Otherwise, if you are evaluating your own custom trained model, you should prepare your own images/annotations instead of using COCO data.

@Darshcg
Copy link
Author

Darshcg commented Jun 8, 2020

After I reduce the number of images and run, i get the error as shown below

image

@jkjung-avt
Copy link
Owner

I don't have a simple solution. As stated earlier, you should prepare your own dataset for evaluation.

@Darshcg
Copy link
Author

Darshcg commented Jun 8, 2020

Thank you very much @jkjung-avt. But I used your model itself.

@jkjung-avt
Copy link
Owner

The darknet YOLOv3 COCO model was trained by the original author (not me). If you're verifying mAP of that model, then it's advised to use all 5,000 images in "val2017". It might take a few minutes to do inference over all those images.

@Darshcg
Copy link
Author

Darshcg commented Jun 8, 2020

Even after running Evaluation on 5000 images, then also getting the same error
image

@jkjung-avt
Copy link
Owner

This is a known issue of pycocotools. It has been fixed in the latest code. Check out this discussion for more information: cocodataset/cocoapi#356

@Darshcg
Copy link
Author

Darshcg commented Jun 9, 2020

How to resolve the issue? I am using NumPy version:1.18.2

@jkjung-avt
Copy link
Owner

Install the latest "pycocotools".

Or install from GitHub source:

$ sudo pip3 uninstall pycocotools  # remove the old installation
$ cd ${HOME}/src
$ git clone https://github.com/cocodataset/cocoapi.git
$ cd cocoapi/PythonAPI
$ sudo python setup.py build_ext install

@Darshcg
Copy link
Author

Darshcg commented Jun 9, 2020

Thank you very much, Jung. I successfully completed the evaluation.
Btw, what's the different between mAP @ IoU=0.5:0.95 and mAP @ IoU=0.5?

@jkjung-avt
Copy link
Owner

@Darshcg
Copy link
Author

Darshcg commented Jun 9, 2020

Thank you very much for all your help and support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants