Coder Social home page Coder Social logo

Comments (13)

giomhugo avatar giomhugo commented on July 2, 2024 3

Am I right when I say you are on windows?
If you are on windows, you can change the / with "\\" . (To actually see what is happening, try printing im and seg)

If you're not, then sorry but I don't have any ideas.

Have a good one :)

from image-segmentation-keras.

giomhugo avatar giomhugo commented on July 2, 2024 2

So it worked?
you forgot :
Change the assert( im.split('/')[-1].split(".")[0] == seg.split('/')[-1].split(".")[0] )
to assert( im.split('\\')[-1].split(".")[0] == seg.split('\\')[-1].split(".")[0] )

from image-segmentation-keras.

giomhugo avatar giomhugo commented on July 2, 2024 2

Ok that error is because you are on python 3.X
modification :
itertools.cycle().next() to next(itertools.cycle())

So in your case :
zipped.next() to next(zipped)

from image-segmentation-keras.

matheuscass avatar matheuscass commented on July 2, 2024

Yes, I'm on windows. I did the following (after aplying the modification you suggested):
print(im)
print(seg)

and that was the response:

data/dataset1/images_prepped_test\0016E5_08159.png
data/dataset1/annotations_prepped_test\0016E5_08159.png
data/dataset1/images_prepped_train\0016E5_08640.png
data/dataset1/annotations_prepped_train\0016E5_08640.png

from image-segmentation-keras.

matheuscass avatar matheuscass commented on July 2, 2024

Now I'm having this error:
Traceback (most recent call last):
File "train.py", line 90, in
m.fit_generator( G , 512 , validation_data=G2 , validation_steps=200 , epochs=1 )
File "C:\Users\Matheus\Anaconda3\envs\tensorflow\lib\site-packages\keras\legacy\interfaces.py", line 91, in wrapper
return func(*args, **kwargs)
File "C:\Users\Matheus\Anaconda3\envs\tensorflow\lib\site-packages\keras\engine\training.py", line 1415, in fit_generator
initial_epoch=initial_epoch)
File "C:\Users\Matheus\Anaconda3\envs\tensorflow\lib\site-packages\keras\engine\training_generator.py", line 177, in fit_generator
generator_output = next(output_generator)
File "C:\Users\Matheus\Anaconda3\envs\tensorflow\lib\site-packages\keras\utils\data_utils.py", line 793, in get
six.reraise(value.class, value, value.traceback)
File "C:\Users\Matheus\Anaconda3\envs\tensorflow\lib\site-packages\six.py", line 693, in reraise
raise value
File "C:\Users\Matheus\Anaconda3\envs\tensorflow\lib\site-packages\keras\utils\data_utils.py", line 658, in _data_generator_task
generator_output = next(self._generator)
File "C:\Users\Matheus\Desktop\UFRGS\Mestrado\tutorial_python\APLICACAO_A_AGRICULTURA\image-segmentation-keras-master\LoadBatches.py", line 82, in imageSegmentationGenerator
im , seg = zipped.next()
AttributeError: 'itertools.cycle' object has no attribute 'next'

=(

from image-segmentation-keras.

matheuscass avatar matheuscass commented on July 2, 2024

I made the modification you mentioned, I think that assertion error is ok now, but I'm having this new error I've just mentioned above =(

from image-segmentation-keras.

matheuscass avatar matheuscass commented on July 2, 2024

It worked! thanks a lot for your time!!! I'm rookie on python, so it's kind of hard to solve these errors on my own... I want to use the code to apply to my own dataset, so it's likely I'll need help again...

Thanks again!

from image-segmentation-keras.

giomhugo avatar giomhugo commented on July 2, 2024

You're very welcome !
If you ever have a problem or an error just type it in google and you will surely find solutions :p

from image-segmentation-keras.

matheuscass avatar matheuscass commented on July 2, 2024

Could you answer one more question? The instructions by the author tell us to use --input_height = 320 and --input_width = 640, but these are not the exact dimensions of the images from the dataset. How those values influence on the code?

from image-segmentation-keras.

giomhugo avatar giomhugo commented on July 2, 2024

For me, they cause an error for me ! I removed these arguments
Sorry can't help you on that :(

from image-segmentation-keras.

divamgupta avatar divamgupta commented on July 2, 2024

@matheuscass there are multiple reasons that we do not use the original size of the images. If the images are very large, the the size of the CNN would also increase which means slower training time and more memory. In most cases, larger the image, you would have to use more number of layers.

from image-segmentation-keras.

giomhugo avatar giomhugo commented on July 2, 2024

@divamgupta
Let’s say my dataset are images of same dimensions (weird ratio 624*464) but the images I want to predict come from a phone (so dimensions like 1080p). What should I modify in order to get good dimensions on the prediction ?

from image-segmentation-keras.

divamgupta avatar divamgupta commented on July 2, 2024

You can first resize the image before inputting to the model and resize the output to the original dimensions

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.