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

Training exception #71

Open
NguyenKhacPhuc opened this issue Nov 7, 2020 · 3 comments
Open

Training exception #71

NguyenKhacPhuc opened this issue Nov 7, 2020 · 3 comments

Comments

@NguyenKhacPhuc
Copy link

image
By the time i'm tranning, it's raising this error, what could be the cause? Thanks

@Rodinaalaa
Copy link

Rodinaalaa commented Nov 26, 2020

@NguyenKhacPhuc I am getting the same error, Not sure what am i supposed to do! I trained before the model on a dataset, and currently got new data, and all of a sudden i got this error! I tried converting tensor x in rpn_loss_regr_fixed_num to float 32 and the error seems persistent!

@NguyenKhacPhuc
Copy link
Author

NguyenKhacPhuc commented Nov 26, 2020 via email

@Sylv-Lej
Copy link

Sylv-Lej commented Dec 28, 2020

Exception caused by some images, i don't know why, i'm investigating.

I fixed it by casting in loss function

def class_loss_regr_fixed_num(y_true, y_pred):
        num_classes_float =  K.cast(num_classes, 'float32')
        indice_slice = K.cast(4 * num_classes_float, 'int32')
        x = K.cast(y_true[:, :, indice_slice:], 'float32') - K.cast(y_pred, 'float32')
        x_abs = K.abs(x)
        x_bool = K.cast(K.less_equal(x_abs, 1.0), 'float32')
        deviser = K.sum(epsilon + K.cast(y_true[:, :, :indice_slice],"float32"))
        devided = K.sum(K.cast(y_true[:, :, :indice_slice], 'float32') * (x_bool * (0.5 * x * x) + (1 - x_bool) * (x_abs - 0.5)))
        return lambda_cls_regr * devided / deviser

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