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

Train error #13

Closed
donglin8506 opened this issue Aug 14, 2019 · 12 comments
Closed

Train error #13

donglin8506 opened this issue Aug 14, 2019 · 12 comments

Comments

@donglin8506
Copy link

donglin8506 commented Aug 14, 2019

@JingChaoLiu Hello, I have a error when run PMTD_demo.py (--method="PlaneClustering"), but I modify --method = “HardThreshold”, it ok. I dont kwon why. And I use the trained model by myself.

Traceback (most recent call last):
File "/home/donglin/projects/PMTD-inference/demo/PMTD_demo.py", line 104, in
main()
File "/home/donglin/projects/PMTD-inference/demo/PMTD_demo.py", line 84, in main
predictions = pmtd_demo.run_on_opencv_image(image)
File "/home/donglin/projects/PMTD-inference/demo/predictor.py", line 175, in run_on_opencv_image
predictions = self.compute_prediction(image)
File "/home/donglin/projects/PMTD-inference/demo/predictor.py", line 223, in compute_prediction
masks = self.masker.forward_single_image(masks, prediction)
File "/home/donglin/projects/PMTD-inference/demo/inference.py", line 27, in forward_single_image
for mask, box in zip(masks, boxes.bbox)
File "/home/donglin/projects/PMTD-inference/demo/inference.py", line 27, in
for mask, box in zip(masks, boxes.bbox)
File "/home/donglin/projects/PMTD-inference/demo/inference.py", line 44, in reg_pyramid_in_image
planes = plane_clustering(pos_points, planes)
File "/home/donglin/projects/PMTD-inference/demo/inference.py", line 87, in plane_clustering
A = torch.gels(B, X)[0][:3]
RuntimeError: Lapack Error in gels : The 1-th diagonal element of the triangular factor of A is zero at /opt/conda/conda-bld/pytorch_1556653114079/work/aten/src/TH/generic/THTensorLapack.cpp:165

@kapness
Copy link

kapness commented Aug 14, 2019

@donglin8506 Hi, I reimplemented the baseline on maskrcnn.However,my result on ICDAR17 only reaches 73.5%, far away from 76% mentioned in paper. I'm confused about it. Could you please share the baseline source code with me?

@JingChaoLiu
Copy link
Collaborator

@donglin8506 A quick way for walking around is replacing except ValueError as e here with except (RuntimeError, ValueError) as e.
This error may raise from an unexpected mask. See this mask by modifing the method reg_pyramid_in_image:

 def reg_pyramid_in_image(self, mask, box):
        ...
        except ValueError as e:
            # logger.info(f'catch Exception: {e}')
            points = boundary
        except RuntimeError as e:
            logger.info(f'catch Exception: {e}')
            import cv2
            mask_numpy = mask.numpy()
            cv2.imshow('image', mask_numpy)
            cv2.waitkey(0)
            exit(0)
        ...

@donglin8506
Copy link
Author

@JingChaoLiu I find that nearly all images occurs the situation in icdar2013. So this is because my trained model is bad? And then How I get correct result by PlaneClustering(method). Please, thank you !

@donglin8506
Copy link
Author

@kapness So sorry, I only train in icdar2013 and test in icdar2013 and icdar2015, but not in mlt2017.

@JingChaoLiu
Copy link
Collaborator

@donglin8506 Could you attach a mask image?

@donglin8506
Copy link
Author

This icdar13 img_9.jpg.

Under--method = HardThreshold, the test result is as follow:
image

This is mask in PlaneClustering method as follow:
image

@JingChaoLiu
Copy link
Collaborator

The ability of clustering the points into four planes comes from the gradient information between pixels. So the input of PlaneClustering has to be a soft mask as shown in the paper. Did you train this model by binary mask instead of pyramid mask?

@donglin8506
Copy link
Author

@JingChaoLiu Thanks very much. So I want to known where is the configuration of select binary mask or pyramid mask. Because I don't encounter this mask choice in my training process.

@JingChaoLiu
Copy link
Collaborator

Sorry, this work(PMTD) is performed on a company-private framework. Transfering all of the train code into maskrcnn-benchmark may need a long time. Recently, the train code may be inaccessible.

@donglin8506
Copy link
Author

donglin8506 commented Aug 14, 2019

@JingChaoLiu Still thank you very much, But I still want to know that only use tools/train_net.py and modified config and code, it's not enough to get good accuracy? Because I am training process in this way.

@JingChaoLiu
Copy link
Collaborator

The train scheduler in #2 and the relative improvement in #7 can be as a valid guideline. I'm afraid these details have covered all I have done for the baseline.

@donglin8506
Copy link
Author

Thank you Very much! Best regards!

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

3 participants