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

Results from a trained model of mine. #18

Closed
changjo opened this issue Jul 9, 2018 · 8 comments
Closed

Results from a trained model of mine. #18

changjo opened this issue Jul 9, 2018 · 8 comments

Comments

@changjo
Copy link
Contributor

changjo commented Jul 9, 2018

Hi,
Thanks for your codes.
I trained the model with only changing batch size to 4 and I predicted some test images.
The right part in the image from a trained model is distorted and right parts in other results are also similar.
I was wondering why this happened and what your pre-trained parameters or any pre-processing except splitting a image to left and right are. Thanks.

  • "Original image"
    0004d4463b50_03

  • Result from pre-trained model "MODEL.pth"
    pretrained_output_03

  • Result from my trained model
    trained_output_03

@milesial
Copy link
Owner

Hello, that's strange. I didn't preprocess except for the rescaling and splitting.
I used the train script as it is, but with a batch size of 1 because of memory issues.

I don't remember the learning rate I used or the number of epochs, but you should try letting it run longer, with a different learning rate.

Also when predicting you can try to set the mask threshold to a higher value :

parser.add_argument('--mask-threshold', '-t', type=float,
like 0.6 or more, so less pixels are considered white.

Last thing, have you tried using the CRF postprocessing ? That might help a bit.

@changjo
Copy link
Contributor Author

changjo commented Jul 11, 2018

Hi,
I used the CRF postprocessing but seems not to help. I also tried to change the mask threshold but not working..
I may try to change the learning rate and the number of epochs. Thanks.

@bermudezarii
Copy link

At the end, what did you do @changjo? Did you get a better result? Thanks!
Because I have the same problem as yours, also, where does the model from the new training is saved? Is the last checkpoint?

Thanks!

@changjo
Copy link
Contributor Author

changjo commented Sep 6, 2018

@bermudezarii I tried to change the learning rate, the training epochs, and batch size but I did not work... Currently, I have not been looking into the codes...

@LinglanZhao
Copy link

How can I get the pre-trained model "MODEL.pth"? (or I have to train a segmentation model from scratch?) @changjo @milesial

@milesial
Copy link
Owner

milesial commented Nov 7, 2019

The pretrained model was available for the commit https://github.com/milesial/Pytorch-UNet/tree/e2e46ce509382a45b1db4e1f639aeed568f6cb3e and before. After that, I cleaned up the code and the model and I don't think the same file will load.

@LinglanZhao
Copy link

Thanks and MODEL.pth can be loaded successfully using the corresponding commit!

@changjo
Copy link
Contributor Author

changjo commented Nov 8, 2019

I have not recognized the repo was updated.

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

4 participants