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

Unexpected version found while deserializing dlib::add_skip_layer when load Emotion Estimator Model #231

Open
Augmented-Chords opened this issue Jul 3, 2023 · 0 comments

Comments

@Augmented-Chords
Copy link

Augmented-Chords commented Jul 3, 2023

I downloaded Corrective re-annotation of FER - CK+ - KDEF and ran program FaceRecognitionDotNet/tools
/EmotionTraining then I got the following results.

2023-07-03 15:58:55.6154 [INFO ] done training
2023-07-03 15:58:57.4307 [INFO ] training num_right: 13199
2023-07-03 15:58:57.4307 [INFO ] training num_wrong: 16369
2023-07-03 15:58:57.4307 [INFO ] training accuracy:  0.446394751082251
2023-07-03 15:58:57.6349 [INFO ] testing num_right: 1593
2023-07-03 15:58:57.6349 [INFO ] testing num_wrong: 1693
2023-07-03 15:58:57.6349 [INFO ] testing accuracy:  0.484783931832015
2023-07-03 15:58:57.7513 [INFO ] 'F:\fer_ckplus_kdef\result\Corrective_re-annotation_of_FER_CK+_KDEF-mlp_3000_0.0005_5E-09_512.tmp' was cleaned and 'F:\fer_ckplus_kdef\result\Corrective_re-annotation_of_FER_CK+_KDEF-mlp_3000_0.0005_5E-09_512.dat' is created.
2023-07-03 15:58:57.7654 [INFO ] 'F:\fer_ckplus_kdef\result\Corrective_re-annotation_of_FER_CK+_KDEF-mlp_3000_0.0005_5E-09_512_test_best_0.48934875228241.tmp' was cleaned and 'F:\fer_ckplus_kdef\result\Corrective_re-annotation_of_FER_CK+_KDEF-mlp_3000_0.0005_5E-09_512_test_best_0.48934875228241.dat' is created.
2023-07-03 15:58:57.7761 [INFO ] 'F:\fer_ckplus_kdef\result\Corrective_re-annotation_of_FER_CK+_KDEF-mlp_3000_0.0005_5E-09_512_train_best_0.449979707792208.tmp' was cleaned and 'F:\fer_ckplus_kdef\result\Corrective_re-annotation_of_FER_CK+_KDEF-mlp_3000_0.0005_5E-09_512_train_best_0.449979707792208.dat' is created.

Everything looks fine. But I encountered this error

DlibDotNet.SerializationException: 'An error occurred while trying to read the first object from the file dlib-models/Corrective_re-annotation_of_FER_CK+_KDEF-mlp_3000_0.0005_5E-09_512_test_best_0.48934875228241.dat.
ERROR: Unexpected version found while deserializing dlib::add_skip_layer.

When I ran the following code

            using (var fr = FaceRecognition.Create("dlib-models"))
            using (var image = FaceRecognition.LoadImage(imageFile))
            {
                var box = fr.FaceLocations(image, model: Model.Cnn).FirstOrDefault();
               //↓Unhandled exception occurs on this line
                using (var emotionEstimator = new SimpleEmotionEstimator("dlib-models/Corrective_re-annotation_of_FER_CK+_KDEF-mlp_3000_0.0005_5E-09_512_test_best_0.48934875228241.dat"))
                {
                    fr.CustomEmotionEstimator = emotionEstimator;
                    var emotion = fr.PredictEmotion(image, box);
                }
            }

I trained this model using DlibDotNet (CPU) in 19.21.0.20220724 .
I tried to run my program with FaceRecognitionDotNet (CPU) in 1.3.0.7 and 1.3.0.6 on my Windows 11 PC. The same error occurred in both.🥺

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

1 participant