Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
happysheep224 opened this issue Jun 21, 2020 · 4 comments
Open

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

happysheep224 opened this issue Jun 21, 2020 · 4 comments

Comments

@happysheep224
Copy link

happysheep224 commented Jun 21, 2020

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
Copy link
Author

@ankur219

@bluecamel
Copy link

I got past this by downgrading keras to 2.3.1.

@happysheep224
Copy link
Author

I got past this by downgrading keras to 2.3.1.

thank you!

@bluecamel
Copy link

No worries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants