pablovin / FaceChannel

The FaceChannel model for facial expression recognition.
GNU Lesser General Public License v3.0
21 stars 10 forks source link

bad marshal data #7

Open eedy8888 opened 3 years ago

eedy8888 commented 3 years ago

When I run the runWebcam it always shows the ValueError: bad marshal data (unknown type code), I found the most popular solution of this by google, it tells me to delete the pyc files, but after I did that, this error still occurs.

File "c:\vaemo\FaceChannel-master\runWebcam.py", line 35, in modelCategorical = modelLoader.modelLoader(modelDictionary.CategoricaModel) File "c:\vaemo\FaceChannel-master\Utils\modelLoader.py", line 42, in init self.loadModel() File "c:\vaemo\FaceChannel-master\Utils\modelLoader.py", line 47, in loadModel self._model = load_model(self.modelDictionary.modelDirectory, custom_objects={'fbeta_score': metrics.fbeta_score, 'rmse': metrics.rmse, 'recall': metrics.recall, 'precision': metrics.precision, 'ccc': metrics.ccc}) File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\keras\saving\save.py", line 206, in load_model return hdf5_format.load_model_from_hdf5(filepath, custom_objects, File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\keras\saving\hdf5_format.py", line 183, in load_model_from_hdf5 model = model_config_lib.model_from_config(model_config, File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\keras\saving\model_config.py", line 64, in model_from_config return deserialize(config, custom_objects=custom_objects) File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\keras\layers\serialization.py", line 173, in deserialize
return generic_utils.deserialize_keras_object( File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\keras\utils\generic_utils.py", line 354, in deserialize_keras_object return cls.from_config( File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\keras\engine\training.py", line 2261, in from_config return functional.Functional.from_config( File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\keras\engine\functional.py", line 668, in from_config
input_tensors, output_tensors, created_layers = reconstruct_from_config( File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\keras\engine\functional.py", line 1275, in reconstruct_from_config process_layer(layer_data) File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\keras\engine\functional.py", line 1257, in process_layer
layer = deserialize_layer(layer_data, custom_objects=custom_objects) File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\keras\layers\serialization.py", line 173, in deserialize
return generic_utils.deserialize_keras_object( File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\keras\utils\generic_utils.py", line 354, in deserialize_keras_object return cls.from_config( File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\keras\layers\core.py", line 1019, in from_config function = cls._parse_function_from_config( File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\keras\layers\core.py", line 1071, in _parse_function_from_config function = generic_utils.func_load( File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\keras\utils\generic_utils.py", line 457, in func_load
code = marshal.loads(raw_code) ValueError: bad marshal data (unknown type code)

eedy8888 commented 3 years ago

Sorry for bothering you, could you please help me?

anitakolz commented 1 year ago

Sorry for bothering you, could you please help me?

You have to use the same Python, Keras and TF version of the built model. It can fix the problem.

sanmii commented 8 months ago

Could please specify the versions you used for each component?

eedy8888 commented 7 months ago

I had already forgotten about this problem, sorry. I thought I had solved it by changing some versions.

Ane San Martin @.***> 於 2024年4月3日 週三 上午7:05寫道:

Could please specify the versions you used for each component?

— Reply to this email directly, view it on GitHub https://github.com/pablovin/FaceChannel/issues/7#issuecomment-2033259770, or unsubscribe https://github.com/notifications/unsubscribe-auth/AL66QLICKW3DJAYUZPU3NILY3M2U3AVCNFSM45T2QTZ2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TEMBTGMZDKOJXG4YA . You are receiving this because you authored the thread.Message ID: @.***>

sanmii commented 7 months ago

Hey, yes! I made it work too! It must be installed the TF and Keras version write down in the requirements.txt file and the python version needed was python 3.6, running in 64-bit. I think this issue may can be closed (: