Code Monkey home page Code Monkey logo

Comments (14)

leimao avatar leimao commented on July 29, 2024 1

Will you be able to print out the variable "image_filenames"?

from deeplab-v3.

ragavendranbala avatar ragavendranbala commented on July 29, 2024 1

Will check and tell you soon

from deeplab-v3.

leimao avatar leimao commented on July 29, 2024 1

Yeah, I was in the same stage. Practice makes you better.

from deeplab-v3.

ragavendranbala avatar ragavendranbala commented on July 29, 2024

Don't know,I used only python test_demo.py command

from deeplab-v3.

leimao avatar leimao commented on July 29, 2024

I just tested the script on Ubuntu 16.04, and everything worked fine. I think this might be a compatibility issue with Windows, although I have never tested it on Windows previously.

To trouble shoot, first please make sure you have the latest version of tqdm installed. Then please modify the function "image_channel_means" in the script "utils.py" to print out the variable "image_filenames".

It would be something like this:

def image_channel_means(image_filenames):
    '''
    Calculate the means of RGB channels in image dataset.
    Support extremely large images of different sizes and arbitrarily large number of images.
    image_filenames: list of image filenames
    '''

    print(image_filenames)

    num_pixels = 0
    channel_sums = np.zeros(3, dtype=object)

    for image_filename in tqdm(image_filenames):
        image = cv2.imread(image_filename)
        channel_sums += np.sum(image, axis=(0, 1))
        num_pixels += np.prod(image.shape[:2])

    channel_means = (channel_sums / num_pixels).astype(float)

    return channel_means

We want to make sure that the variable "image_filenames" is still a list when you call this function.

If it turns out the variable "image_filenames" is indeed a list variable containing all the image filenames. This is highly likely that the tqdm package was not very compatible with Windows. Instead of using for image_filename in tqdm(image_filenames):, please use for image_filename in image_filenames:, you will lose progress bar though.

I apologize that I don't have Windows environment to troubleshoot it directly for you.

from deeplab-v3.

leimao avatar leimao commented on July 29, 2024

Thanks, I am also interested in knowing why this does not work on Windows.

from deeplab-v3.

ragavendranbala avatar ragavendranbala commented on July 29, 2024

Hi, I used you above code and got this

D:\Ragavendranbala\Image Processing\DeepLab_v3-master>python test_demo.py
Calculating pixel means for each channel of images...
None
0it [00:00, ?it/s]Traceback (most recent call last):
File "test_demo.py", line 20, in
channel_means = save_load_means(means_filename='channel_means.npz', image_filenames=None)
File "D:\Ragavendranbala\Image Processing\DeepLab_v3-master\utils.py", line 47, in save_load_means
channel_means = image_channel_means(image_filenames=image_filenames)
File "D:\Ragavendranbala\Image Processing\DeepLab_v3-master\utils.py", line 26, in image_channel_means
for image_filename in tqdm(image_filenames):
File "C:\Users\ragav\AppData\Local\Programs\Python\Python35\lib\site-packages\tqdm_tqdm.py", line 937, in iter
for obj in iterable:
TypeError: 'NoneType' object is not iterable

tpdm =4.26.0

from deeplab-v3.

ragavendranbala avatar ragavendranbala commented on July 29, 2024

Used this

for image_filename in image_filenames:

and Got

D:\Ragavendranbala\Image Processing\DeepLab_v3-master>python test_demo.py
Calculating pixel means for each channel of images...
None
Traceback (most recent call last):
File "test_demo.py", line 20, in
channel_means = save_load_means(means_filename='channel_means.npz', image_filenames=None)
File "D:\Ragavendranbala\Image Processing\DeepLab_v3-master\utils.py", line 47, in save_load_means
channel_means = image_channel_means(image_filenames=image_filenames)
File "D:\Ragavendranbala\Image Processing\DeepLab_v3-master\utils.py", line 26, in image_channel_means
for image_filename in image_filenames:
TypeError: 'NoneType' object is not iterable

from deeplab-v3.

leimao avatar leimao commented on July 29, 2024

I think I know what your problem is. I bet you did not train the model but direct ran the test_demo.py script.

This will not work because the test_demo.py requires a file called channel_means.npz. This file will be generated during the data preprocessing/training time. Please double check if you have this file in your directory.

Since we did not provide a pre-trained model, you will have to train the model first then run the test demo script.

from deeplab-v3.

ragavendranbala avatar ragavendranbala commented on July 29, 2024

Oh! First of all I have to train the model, then only, I have to run this script! Okay make sense.. I need to know how to train my own data which has labelled floor images. Can you share me a step by step guide to train my own model using xception or mobilenet?
Thanks in advance

from deeplab-v3.

leimao avatar leimao commented on July 29, 2024

I am probably not going through it myself, since it is not a program problem or issue. The basic instructions were in the README file. You are free to read and modify any code you want based on your own needs.

from deeplab-v3.

ragavendranbala avatar ragavendranbala commented on July 29, 2024

Okay thanks. Try to change the code. But I'm a beginner in python so only asked.

from deeplab-v3.

ragavendranbala avatar ragavendranbala commented on July 29, 2024

Thank you let's close this issue. And ping u of I faced anything again

from deeplab-v3.

leimao avatar leimao commented on July 29, 2024

You are welcome.

from deeplab-v3.

Related Issues (5)

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.