patrikhuber / eos

A lightweight 3D Morphable Face Model library in modern C++
Apache License 2.0
1.89k stars 596 forks source link

Error when load converted bfm2017-1_face12_nomouth.bin #270

Closed jiaxiangshang closed 4 years ago

jiaxiangshang commented 4 years ago

Hi, patrikhuber I meet an error after using script/convert-bfm2017-to-eos.py to get bfm2017-1_face12_nomouth.bin, then I used morphablemodel::load_model(path_modelfile);. However, this error message shows Error loading the Morphable Model: Failed to read 8 bytes from input stream! Read 4 Detail, I have tried the sfm_shape_3448.bin, it worked. Any suggest? Really thanks to your great code. It helps a lot. Jiaxiang

patrikhuber commented 4 years ago

Hi @jiaxiangshang, Thanks for the nice words. I suggest that you try to also use the Python bindings to load the converted BFM. If you use the same Python bindings to convert and then load the model, it should really work. If that works, then you know something is probably wrong with your C++ build (perhaps a different/old eos version?).

jiaxiangshang commented 4 years ago

Thanks to your quick reply. I also try the python binding, and it has the same error.

And by you suggest, I solve the problem. The python bindings have problem because I use python2.7 that I install eos-py form source and changed the setup.py. It seems that it is also because of my cpp setting. Besides, I have trouble when compiling cpp eos, so I changed to cpp17 version cereal, it seems some version's cereal may generate contradict between "save_model" and "load_model".

Finally, I use python3 to run the convert script and solve the problem.

Jiaxiang

patrikhuber commented 4 years ago

Great that you solved the problem. I am not 100% sure that I understand correctly, but it sounds like different versions of cereal were somehow used. What exactly do you mean with the "cpp17 version cereal"?

jiaxiangshang commented 4 years ago

I using c++ 17 to compile eos, then the cereal also needs to use the branch cpp17_test which seems not a std version. And it seems the reason why the contradict happen. I am trying to compile with the c++11

patrikhuber commented 4 years ago

@jiaxiangshang That's very interesting to know. What operating system and exact compiler and compiler version are you using?

patrikhuber commented 4 years ago

@jiaxiangshang I just had a quick look at this. Actually, I think you cloned eos and the cereal submodule in the wrong way. When eos is cloned using --recursive, it clones cereal from its develop branch, and the cereal cpp17_tests branch is already merged into their develop branch. If you clone eos correctly, you'll get the correct cereal branch.

So I can only assume that you cloned cereal manually somehow, and cloned their master branch, which is indeed quite old.

If you do git submodule update --init --recursive from within the eos repo, then the correct branch from cereal should be checked out.

I am going to close this, as I am pretty sure that my suspicion is correct. It would be great if you reported back with a comment and feel free to re-open if you think that my suspicion is not correct.

jiaxiangshang commented 4 years ago

Oh, yes! I forgot the --recursive. Really thanks your patient help.

Jiaxiang

Patrik Huber notifications@github.com 于2019年7月19日周五 下午6:14写道:

@jiaxiangshang https://github.com/jiaxiangshang I just had a quick look at this. Actually, I think you cloned eos and the cereal submodule in the wrong way. When eos is cloned using --recursive, it clones cereal from its develop branch, and the cereal cpp17_tests branch is already merged into their develop branch. If you clone eos correctly, you'll get the correct cereal branch.

So I can only assume that you cloned cereal manually somehow, and cloned their master branch, which is indeed quite old.

If you do git submodule update --init --recursive from within the eos repo, then the correct branch from cereal should be checked out.

I am going to close this, as I am pretty sure that my suspicion is correct. It would be great if you reported back with a comment and feel free to re-open if you think that my suspicion is not correct.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/patrikhuber/eos/issues/270?email_source=notifications&email_token=AFBU4PHOTUR3677PENYEBQLQAGHYZA5CNFSM4IEYUW22YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2LHDCQ#issuecomment-513175946, or mute the thread https://github.com/notifications/unsubscribe-auth/AFBU4PEXOTOPG4UAXE6K5Z3QAGHYZANCNFSM4IEYUW2Q .