Comments (3)
Tutorial works as expected on keras 2.1.* (probably should add this to README if this is only intended to work with older versions of keras)
However with keras 2.2.* it generates the following error
Traceback (most recent call last): File "006_autoencoder.py", line 90, in <module> SEG.decode_all_images(d, data_dir) File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/aitom/classify/deep/unsupervised/autoencoder/seg_src.py", line 61, in decode_all_images autoencoder = KM.load_model(op_join(data_dir, 'model', 'model-autoencoder.h5')) File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/keras/engine/saving.py", line 419, in load_model model = _deserialize_model(f, custom_objects, compile) File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/keras/engine/saving.py", line 258, in _deserialize_model .format(len(layer_names), len(filtered_layers)) ValueError: You are trying to load a weight file containing 7 layers into a model with 0 layers
Possible cause of this error include:
- the use of keras Input layer
- the presence of the
input_shape
parameter in function calls to keras.layers
Please refer to this issue for more details
Another possible workaround is proposed here. This workaround doesn't require changing the code line by line and add the additional parameter, but it seems a bit "hacky".
from aitom.
hi @buptwhr can you check the problem detected by @yg422 ?
from aitom.
@yg422 I've noticed this problem, so I put keras==2.1.0 in requirements.txt. As for the issue you've mentioned, I read it before. But I don't know how to avoid Input or input_shape.
By using autoencoder.load_weights()
rather than KM.load_model()
, I can solve the problem. But there are so many KM.load_model()
and save_model
in the project. I am not sure it'a stable choice.
I suggest using keras==2.1.0 to make minimal change to the original code.
from aitom.
Related Issues (20)
- patch codebase with other files
- Fill up publications
- HDF Support HOT 1
- Runtime of aitom.filter.smooth HOT 1
- formating tutorial 007 HOT 3
- tomominer.simulation.reconstruction__simple_convolution cannot find module tomominer HOT 2
- Logic error in code HOT 1
- docker instructions lead to dependency error
- Facing problem running ProtoNet HOT 2
- tutorials 005 HOT 2
- Gum-Net Training not improving with demo data HOT 4
- Some modules are missing HOT 1
- Particle Picking module doesn't work(008
- Write a program to detect redundant functions HOT 3
- Inspect how to use AWS functionality to support aitom HOT 1
- Integrate Scipion plugin with aitom HOT 1
- Tutorial of cryoet introductory materials HOT 3
- Integrate simulated annealing image selection code
- pip deployment
- Using AITom in Jupyter Notebook and Google Colab HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aitom.