ECG-Arrhythmia-classification icon indicating copy to clipboard operation
ECG-Arrhythmia-classification copied to clipboard

AttributeError: 'list' object has no attribute 'items'

Open happysheep224 opened this issue 5 years ago • 4 comments

I followed the tutorial,

  1. clone ECG-Arrhythmia-classification-master
  2. clone keras-flask-deploy-webapp-master
  3. replace the app.py and index.html
  4. download the weights(model):ecgScratchEpoch2.hdf5
  5. modify the path in app.py: model = load_model('/Users/happysheep224/Documents/python/ECG_PY/ECG-Arrhythmia-classification-master/ecgScratchEpoch2.hdf5'); csv = pd.read_csv('/Users/happysheep224/Documents/python/ECG_PY/ECG-Arrhythmia-classification-master/sample.csv')
  6. run the script

the terminal show like this: (ecg) bogon:keras-flask-deploy-webapp-master happysheep224$ python app.py Using TensorFlow backend. Traceback (most recent call last): File "app.py", line 31, in model = load_model('/Users/happysheep224/Documents/python/ECG_PY/ECG-Arrhythmia-classification-master/ecgScratchEpoch2.hdf5') File "/Users/happysheep224/opt/anaconda3/envs/ecg/lib/python3.7/site-packages/tensorflow/python/keras/saving/save.py", line 184, in load_model return hdf5_format.load_model_from_hdf5(filepath, custom_objects, compile) File "/Users/happysheep224/opt/anaconda3/envs/ecg/lib/python3.7/site-packages/tensorflow/python/keras/saving/hdf5_format.py", line 178, in load_model_from_hdf5 custom_objects=custom_objects) File "/Users/happysheep224/opt/anaconda3/envs/ecg/lib/python3.7/site-packages/tensorflow/python/keras/saving/model_config.py", line 55, in model_from_config return deserialize(config, custom_objects=custom_objects) File "/Users/happysheep224/opt/anaconda3/envs/ecg/lib/python3.7/site-packages/tensorflow/python/keras/layers/serialization.py", line 109, in deserialize printable_module_name='layer') File "/Users/happysheep224/opt/anaconda3/envs/ecg/lib/python3.7/site-packages/tensorflow/python/keras/utils/generic_utils.py", line 362, in deserialize_keras_object config, module_objects, custom_objects, printable_module_name) File "/Users/happysheep224/opt/anaconda3/envs/ecg/lib/python3.7/site-packages/tensorflow/python/keras/utils/generic_utils.py", line 325, in class_and_config_for_serialized_keras_object for key, item in cls_config.items(): AttributeError: 'list' object has no attribute 'items'

happysheep224 avatar Jun 21 '20 07:06 happysheep224

@ankur219

happysheep224 avatar Jun 21 '20 07:06 happysheep224

I got past this by downgrading keras to 2.3.1.

bluecamel avatar Jul 10 '20 06:07 bluecamel

I got past this by downgrading keras to 2.3.1.

thank you!

happysheep224 avatar Jul 10 '20 07:07 happysheep224

No worries.

bluecamel avatar Jul 10 '20 07:07 bluecamel