Cannot save trained model after loading it AttributeError: 'list' object has no attribute 'tolist'
See original GitHub issueHello,
I wanted to train model a bit more after some epochs. I had it saved and I loaded it and then I performed training. Loss function started to becoming smaller from the point where the previous model was saved, but after training it was not possible to save this newly trained model again.
Here’s a listing with error:
Traceback (most recent call last):
File ".../Programming/keras-retinanet-master/examples/train_csv.py", line 125, in <module>
model.save(os.path.join('snapshots', 'resnet50_csv_final.h5'))
File ".../MasterEnv/lib/python3.6/site-packages/keras/engine/topology.py", line 2556, in save
save_model(self, filepath, overwrite, include_optimizer)
File ".../MasterEnv/lib/python3.6/site-packages/keras/models.py", line 107, in save_model
'config': model.get_config()
File ".../MasterEnv/lib/python3.6/site-packages/keras/engine/topology.py", line 2329, in get_config
layer_config = layer.get_config()
File ".../Programming/keras-retinanet-master/keras_retinanet/layers/_misc.py", line 66, in get_config
'ratios' : self.ratios.tolist(),
AttributeError: 'list' object has no attribute 'tolist'
I was following the script train_csv.py I checked alread if saving to other file will fix it and setting override attribute to True is not resolving it.
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
AttributeError: 'list' object has no attribute 'tolist' - Stack Overflow
I did a workaround using numpy. import face_recognition import os import json import numpy as np encodearr=[] for i in range(0, ...
Read more >'list' object has no attribute 'values' when we are using append ...
It is basically what the error message says. The problem is this: y =y.values().astype(int). y is a list and lists do not have...
Read more >attributeerror: 'list' object has no attribute 'patches' - You.com
The Python AttributeError: 'list' object has no attribute occurs when we access an attribute that doesn't exist on a list. To solve the...
Read more >How to Save and Load Your Keras Deep Learning Model
You learned how to save your trained models to files, later load them ... “AttributeError: 'KerasClassifier' object has no attribute 'save'”.
Read more >series object has no attribute columns
Series Object Has No Attribute ColumnsValues exactly lists series object has no attribute 'tolist on characters that appear in the Series is of...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Everything is working now - sorry for late comment - I didn’t have an opportunity to verify this issue 😃 And thanks for fix
Good to hear, thanks for reporting back 😃