Comments (5)
Thanks @PavlosMelissinos! That clarifies a ton!
from enet-keras.
Have you done any finetuning?
You've changed the last layer to recognize fewer classes, so the weights that assign an image to a class are indeed random (kinda, it's actually glorot_uniform
). You need to train the last layer in order to get results that make sense with your new setup.
from enet-keras.
Closing this for now, feel free to reopen it if you still have issues.
from enet-keras.
I changed the setup as per your suggestion (Thank you!) as follows:
-
Set the number of classes to 20:
get_model(20)
I chose 20 because when I calledtransfer_weights()
withkeep_top=True
, I got the error:
ValueError: Layer weight shape (2, 2, 11, 16) not compatible with provided weight shape (2, 2, 20, 16)
And I assumed the weights were trained for 20 classes. Did I make a wrong assumption? -
Didn't discard the top layer:
autoencoder = transfer_weights(model=autoencoder, keep_top=True)
Since I didn't discard the top layer, is it okay to use the functionsave_output()
as defined above?
This time, for the same input image included above, the segmented output created with save_output()
is as follows:
Also, by finetuning, do you mean retraining the model?
from enet-keras.
I'm not sure what I'm seeing. You're assigning random colors to each class so you can't see what class e.g. the pink color corresponds to. The most dominant one should be the background class though.
-
How many classes do you have in your dataset? class 0 corresponds to some concept, you can't just assume it will translate well to your problem. If you want to do inference for 11 classes on a furniture dataset you can't reuse the 20 classes that were trained on a dataset that recognizes cars and pedestrians. You have to retrain in order to reassign the internal representation of the intermediate layers to actual high-level concepts that we understand.
-
If you discard the (weights of the) top layer, then it makes sense to get random outputs like the ones you got before. On the other hand, if you don't discard the (weights of the) top layer, then you'll only be able to segment the objects that exist in the original dataset.
Prediction works with argmax and there's no threshold to filter noise, so if you look more closely to the actual one-hot-vector predictions for each (non-background) pixel, you should be seeing low values for all classes (low confidence). Technically you should get 100% background but the network isn't perfect and I'm pretty sure there's a bug somewhere in my implementation of enet that I haven't pinpointed yet.
Re: Finetuning. Come on, it's pretty common stuff, you could have looked it up. ;)
from enet-keras.
Related Issues (20)
- [Feature request] Multi-scale inputs (arbitrary shape)
- Bad results - Investigate reason HOT 22
- Add support for more datasets HOT 1
- How to save checkpoint during training? HOT 3
- Speed up inference HOT 3
- pretrained file and enet_unpooling_best.h5 missing? HOT 3
- Where to download the pretrained/torch_enet.pkl file? HOT 11
- UpSampling vs MaxUnpooling HOT 2
- COCO labels HOT 3
- about the label format HOT 2
- questioins about the bottleneck definition
- src/models/from_torch.py needs to be updated HOT 1
- SUNRGBD2Dseg = hdf5storage.loadmat(filename) HOT 1
- Fix dependencies HOT 3
- Replace conda with poetry HOT 1
- End-to-end training HOT 3
- Fix data loading from disk
- datasets.py standardization HOT 1
- Can't train on MSCOCOReduced
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 enet-keras.