Coder Social home page Coder Social logo

Comments (15)

noamgal avatar noamgal commented on July 20, 2024 11

@anas-899 @VeniVidiGavi I just removed the arguments input_width and input_height for both train.py and predict.py and it worked well

from image-segmentation-keras.

quelibrio avatar quelibrio commented on July 20, 2024 4

Yes default values don't work. Just go to /home/.keras/keras.json and change to
{
"floatx": "float32",
"epsilon": 1e-07,
"backend": "theano",
"image_data_format": "channels_last"
}

from image-segmentation-keras.

Cbanyungong avatar Cbanyungong commented on July 20, 2024 3

This error happens because VGG16 was designed for images with size of 224. But the given code uses Input(shape=(3,416,608). If you do not replace the input shape with (3,224,224),you will meet the error that "ValueError: Dimension 0 in both shapes must be equal, but are ***** and 25088 for 'Assign_26' (op: 'Assign') with input shapes: [****,4096], [25088,4096]".Remove arguments input_width and input_height for both train.py and predict.py and it worked well becasue the train.py and predict.py use default arguments" 224".I find the code don't support tensorflow backend because tensorflow uses "channels_last" and theano uses "channels_first" .So if you want the code support tensorflow backend,just change input shape with (224,224,3) and change "data_format='channels_first'" with " data_format='channels_last". @VeniVidiGavi @anas-899 @quelibrio @gpkc

from image-segmentation-keras.

gpkc avatar gpkc commented on July 20, 2024 2

If you remove the input_width and input_height it will simply use the default size of 224x224 I believe.

from image-segmentation-keras.

DawnMe avatar DawnMe commented on July 20, 2024 1

@noamgal It works well, thanks! I got another error after the fix AttributeError: 'itertools.cycle' object has no attribute 'next', but changes to next(zipped) at "/image-segmentation-keras/LoadBatches.py" and now it works.

from image-segmentation-keras.

divamgupta avatar divamgupta commented on July 20, 2024

Yes, This error is because of the Tensorflow backend. We don;t support tensorflow backend currently. Try installing latest version of nvcc and theano.

from image-segmentation-keras.

anas-899 avatar anas-899 commented on July 20, 2024

@VeniVidiGavi did you discover how to solve it? .. I got the same error

from image-segmentation-keras.

gpkc avatar gpkc commented on July 20, 2024

Then you'll be changing your backend to Theano. Some people can't use Theano (for example if you want to train on Google Cloud ML).

from image-segmentation-keras.

quelibrio avatar quelibrio commented on July 20, 2024

Ye you won't be able to train on google cloud, but since authors state "We don't support tensorflow backend currently" i don't see other option

from image-segmentation-keras.

gpkc avatar gpkc commented on July 20, 2024

@Cbanyungong Why is it exactly that makes it necessary to keep the size 224? Aren't CNNs kernel-based and therefore independent of input size (i.e. they just train the kernel weights)?

from image-segmentation-keras.

Ployl avatar Ployl commented on July 20, 2024

I'm getting this error in Line 105 of the FCN8 ( o = Add()([ o , o2 ])):
ValueError: Operands could not be broadcast together with shapes (14, 16, 10) (14, 14, 10)

Any ideas why this is happening?

I try to use tensorflow as backend aswell and did everything mentioned in this post.

from image-segmentation-keras.

mgq1507 avatar mgq1507 commented on July 20, 2024

@noamgal It works well, thanks! I got another error after the fix AttributeError: 'itertools.cycle' object has no attribute 'next', but changes to next(zipped) at "/image-segmentation-keras/LoadBatches.py" and now it works.

Have you solved the problem?

from image-segmentation-keras.

shodme avatar shodme commented on July 20, 2024

@mgq1507 you can try to replace zipped.next() with zipped._next_() in LoadBatches.py

from image-segmentation-keras.

patrikoss avatar patrikoss commented on July 20, 2024

@gpkc

Why is it exactly that makes it necessary to keep the size 224? Aren't CNNs kernel-based and therefore independent of input size (i.e. they just train the kernel weights)?

CNNs are indeed independent of input size, but VGG net is not fully convolutional. It has some fully-connected layers at the end. At the time of flattening the input the mismatch of the shape occur.

from image-segmentation-keras.

divamgupta avatar divamgupta commented on July 20, 2024

Image segmentation keras has been updated. The new version should fix the issue.

from image-segmentation-keras.

Related Issues (20)

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.