grad2022project / deepfake-detection

GNU General Public License v3.0
4 stars 3 forks source link

ValueError: bad marshal data (unknown type code) #1

Open gowthamcodez opened 1 year ago

gowthamcodez commented 1 year ago

unable to load the model. ValueError: bad marshal data (unknown type code)

I searched stackoverflow and found this answer.

This typically happens when you save a model in one Python version (e.g., 3.6) and then try to load that model in another Python version (e.g., 3.9), as the binary serialization that Keras uses (marshal) is not upwards/downwards compatible. Try to install an old version of Python with an appropriate version of the Tensorflow / Keras libraries. If the model was not trained by yourself, you may ask the creators to export the trained models in a different format that doesn't have these problems, like ONNX.

can you please tell me which python version have you used?

LoginPages commented 1 year ago

hey do you get how to solve this problem?

unable to load the model. ValueError: bad marshal data (unknown type code)

I searched stackoverflow and found this answer.

This typically happens when you save a model in one Python version (e.g., 3.6) and then try to load that model in another Python version (e.g., 3.9), as the binary serialization that Keras uses (marshal) is not upwards/downwards compatible. Try to install an old version of Python with an appropriate version of the Tensorflow / Keras libraries. If the model was not trained by yourself, you may ask the creators to export the trained models in a different format that doesn't have these problems, like ONNX.

can you please tell me which python version have you used?

hey do you get how to solve this problem?

gowthamcodez commented 1 year ago

that problem is due to keras version, this code requires a specific version of keras which we dont know, without it the code is difficult to run. another solution is there which is difficult, that is you should the train your own model using model training code which is given here

SuryaVamsi160703 commented 1 year ago

while loading the model via keras its showing error to me also.... can u help me