GithubHelp home page GithubHelp logo

shathe / semantic-segmentation-tensorflow-eager Goto Github PK

View Code? Open in Web Editor NEW
26.0 3.0 3.0 150.67 MB

An example of semantic segmentation using tensorflow in eager execution.

Python 100.00%
mnasnet semantic-segmentation segmentation eager-execution keras tensorflow

semantic-segmentation-tensorflow-eager's People

Contributors

shathe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

semantic-segmentation-tensorflow-eager's Issues

Error with different dataset

Hi,

I change the example to use my dataset.
I have just one class (the mask has two colors, black and with).
The image has 140x140 pixels.

n_classes = 1
dataset_path = 'seg'

loader = Loader.Loader(dataFolderPath=dataset_path, n_classes=n_classes, problemType='segmentation', width=140,
height=140, ignore_label=n_classes)
model = MnasnetEager.MnasnetFC(num_classes=n_classes)
optimizer = tf.train.AdamOptimizer(0.001)
train(loader=loader, model=model, epochs=20, batch_size=8)
get_params(model)

The result generates an error:
Using TensorFlow backend.
Reading files...
Structuring test and train files...
Loaded 92 training samples
Loaded 10 testing samples
Dataset contains 1 classes
epoch: 0
Traceback (most recent call last):
File "train_eager_seg.py", line 109, in
train(loader=loader, model=model, epochs=20, batch_size=1)
File "train_eager_seg.py", line 44, in train
x, y, mask = loader.get_batch(size=batch_size, train=True, augmenter=augmenter)
File "/pylon5/ac3uump/rafaelmr/Semantic-Segmentation-Tensorflow-Eager/Loader.py", line 377, in get_batch
return self._get_batch_segmentation(size=size, train=train, augmenter=augmenter)
File "/pylon5/ac3uump/rafaelmr/Semantic-Segmentation-Tensorflow-Eager/Loader.py", line 296, in _get_batch_segmentation
y = to_categorical(y, num_classes=self.n_classes+1)
File "/home/rafaelmr/.conda/envs/seg1/lib/python2.7/site-packages/keras/utils/np_utils.py", line 32, in to_categorical
categorical[np.arange(n), y] = 1
IndexError: index 255 is out of bounds for axis 1 with size 2

Probably the error is associated with the number of the classes.
I put the correct number of the classes. I try others numbers, but the problem still the same.
Do I need to code another place?

Can you tell me the corresponding network structure.

Hello, thanks for your work with this code.
I found a lot of class of network in the Network.py. Can you tell me those networks built depending on the existing the network structure or designed by yourself?

Move to Dataset API

Why are all the predicted data sets black?

First of all, thank you for sharing. I use the original dataset to get the correct results, but the final predicted result image of the cityscapes dataset using RGB annotations is all black, and the output is black when I test with my own dataset. Do you know why? thank you very much!

Results are strange

Hi,

I executed your code, but the results are strange:
epoch: 0
Train accuracy: None
Test accuracy: None
epoch: 1
Train accuracy: None
Test accuracy: None
......
epoch: 18
Train accuracy: None
Test accuracy: None
epoch: 19
Train accuracy: None
Test accuracy: None
Total parameters of the net: 6421507 == 6.421507M

Why are all accuracies with none result?

Tks

where is imgaug

from imgaug import augmenters as iaa
ImportError: No module named imgaug

about saving model

I have never used tensorflow eager, and I want to run the saved model on the mobile phone. May I ask you if the model saved by tensorflow eager can be saved as a file in tflite format and run on the mobile phone? Save the model without. What about the meta file? Thank you very much for your help!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.