carolinedunn / Face_Mask_Detection

22 stars 24 forks source link

Error with python3 "decode" #1

Closed rhasan151 closed 3 years ago

rhasan151 commented 3 years ago

I've followed this project of yours. Facing error in the end.

Traceback (most recent call last): File "detect_mask_picam.py", line 95, in maskNet = load_model(args["model"]) File "/usr/local/lib/python3.7/dist-packages/tensorflow_core/python/keras/saving/save.py", line 146, in load_model return hdf5_format.load_model_from_hdf5(filepath, custom_objects, compile) File "/usr/local/lib/python3.7/dist-packages/tensorflow_core/python/keras/saving/hdf5_format.py", line 166, in load_model_from_hdf5 model_config = json.loads(model_config.decode('utf-8')) AttributeError: 'str' object has no attribute 'decode'

Can you please provide a solution? Error

saket424 commented 3 years ago

@rhasan151 Take a look at this issue https://github.com/tensorflow/tensorflow/issues/44467

lewixlabs commented 3 years ago

@carolinedunn I think best workaround is to install alilgned packages to 2.10, using

sudo pip3 install h5py==2.10.0 https://github.com/lhelontra/tensorflow-on-arm/releases/download/v2.1.0/tensorflow-2.1.0-cp37-none-linux_armv7l.whl

With these v2.10 packages face mask detection works! :+1: