Comments (5)
Turns out I made an error when saving the weights for the "No Top" models. I have updated new weights, which should work. However, you will need to delete the local copy stored at ~/.keras/models/NASNet***.h5
from keras-nasnet.
Hey, thanks a lot!
I was having the same issue and was trying to remove the top myself, but it didn't work. For the sake of curiosity, could you please explain how you removed the top?
I tried the following:
- load weights with top
- remove the last three layers on top using pop():
for i in range(0, 3):
base_model.layers.pop()
base_model.outputs = [base_model.layers[-1].output]
base_model.layers[-1].outbound_nodes = []
But it didn't work when I attached a new avg-pool and a softmax.
from keras-nasnet.
It wasn't actually an error with the model itself, but the weight file. When I was creating the no top models, I deleted the extra layers manually, but forgot to update the layer_names property in the weight file.
So even though the weight files didnt contain those weights anymore, it attempted to load them causing the error.
I fixed them by saving the weights properly this time.
from keras-nasnet.
To remove the top, I simply don't add the extra classification layers when building the model. For Models in Keras, you can't apply pop operations.
from keras-nasnet.
Okay, so how do I edit a weight file to remove the top from the weights? It would be awesome if you could explain that. Thanks!
from keras-nasnet.
Related Issues (20)
- Variable Input Shapes HOT 1
- Got ValueError HOT 4
- ValueError from NASNet function HOT 2
- How to train NASNet with my own dataset? HOT 1
- how to load pretrain model? HOT 8
- Cannot Save Weights with Model Checkpoint HOT 7
- About AveragePooling
- prediction result varies from time to time
- skip_reduction parameter not used HOT 1
- A bug in your code HOT 1
- train nasnet model
- Issue with loading directly download image weights
- Value Error: during data augmentation
- Missing addition in reduction cell HOT 1
- CIFAR10 HOT 4
- Issue when using "use_auxilary_branch=True": The model expects 2 target arrays, but only received one array. Found: array with shape (600, 2) HOT 1
- Pooling kernel size HOT 1
- I need your help HOT 1
- Network is not learning :( HOT 31
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 keras-nasnet.