skeyenet icon indicating copy to clipboard operation
skeyenet copied to clipboard

The final model

Open wcatch opened this issue 4 years ago • 7 comments

I tested your road_mapper_final.h5 in test datasets, the output showed a blank image. Did you upload your trained parameters? or we need to train the model by ourselves?

wcatch avatar May 18 '20 22:05 wcatch

Yes, I had uploaded the complete model and you can start testing with the model I uploaded. Please Use the following code to load the model.

from keras.models import load_model
model = load_model("./Models/road_mapper_final.h5", custom_objects={'soft_dice_loss': soft_dice_loss, 'iou_coef': iou_coef})

You will have to define and load the custom losses to get predictions. Do let me know if this doesn't work. Thank you.

Paulymorphous avatar May 21 '20 04:05 Paulymorphous

now this is a terrible question but how do i test it with my own images?

i read the code, what is the test mask? do i need a test mask to use the model with my own images?

and i also i face this :

ValueError: Unknown loss function:dice_coef_loss

while trying to test the network

beipym avatar Jun 29 '20 11:06 beipym

i have defined the two functions for the custom loss that you have in your code , before the load_model , but its still complaining that : ValueError: Unknown loss function:dice_coef_loss

beipym avatar Jun 29 '20 14:06 beipym

I managed to run the code with the given model. You can use the below script. However, Im not 100% sure this is the right way to do.

def iou_coef(y_true, y_pred, smooth=1):
    intersection = K.sum(K.abs(y_true * y_pred), axis=[1, 2, 3])
    union = K.sum(y_true, [1, 2, 3]) + K.sum(y_pred, [1, 2, 3]) - intersection
    iou = K.mean((intersection + smooth) / (union + smooth), axis=0)

    return iou


def dice_coef_loss(y_true, y_pred, smooth=1):
    y_true_f = K.flatten(y_true)
    y_pred_f = K.flatten(y_pred)
    intersection = K.sum(y_true_f * y_pred_f)
    return (2. * intersection + smooth) / (K.sum(y_true_f) + K.sum(y_pred_f) + smooth)


def soft_dice_loss(y_true, y_pred):
    return 1 - dice_coef_loss(y_true, y_pred)


model = load_model("../Models/road_mapper_2.h5",
                   custom_objects={'soft_dice_loss': soft_dice_loss, 'iou_coef': iou_coef,
                                   "dice_coef_loss": dice_coef_loss, "dice_loss": dice_coef_loss})

DogukanAltay avatar Oct 20 '20 10:10 DogukanAltay

Hi! When trying to load de model I get this error: 'OSError: Unable to open file (file signature not found)' related with h5 file. Searching around the most common source of this error is a bad or corrupt file. Anyone had the same error? Any hints? Thanks in advance.

sercava avatar Mar 12 '21 20:03 sercava

I tested your road_mapper_final.h5 in test datasets, the output showed a blank image. Did you upload your trained parameters? or we need to train the model by ourselves?

Hey, I am also facing the same problem, were you able to solve it? Please help me out

AakashRana000q avatar Sep 23 '21 21:09 AakashRana000q

Sorry, I have not tried to make it work after I had placed the question. Good luck.

El jue, 23 sept 2021 a las 23:36, AakashRana000q (<

) escribió:

Preview: > I tested your road_mapper_final.h5 in test datasets, the ou --> SPAM? CLICK to BLOCK @.***/>

This email is Masked using Blur - it was sent from github.com to @.*** (your reply stays Masked). To protect your privacy https://www.abine.com/faq.html#caniaddcc, do not forward this message, or add new recipients like CCs or BCCs.

Thanks for being a Blur customer! If you haven't yet, [ Try DeleteMe at a discount. https://joindeleteme.com/?utm_source=blur&utm_medium=email&utm_campaign=blur-offer ]

I tested your road_mapper_final.h5 in test datasets, the output showed a blank image. Did you upload your trained parameters? or we need to train the model by ourselves?

Hey, I am also facing the same problem, were you able to solve it. Please help me out

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Paulymorphous/skeyenet/issues/7#issuecomment-926181271, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIRIMQ5JCFH74WEMJVPJXPLUDOMTJANCNFSM4NEPGA5A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

sercava avatar Oct 16 '21 11:10 sercava