# unable to use classify-images

**URL:** <https://support.prodi.gy/t/unable-to-use-classify-images/7404>\
**Category:** Uncategorized\
**Created:** [October 3, 2024, 6:08am UTC](https://support.prodi.gy/t/unable-to-use-classify-images/7404 "2024-10-03T06:08:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Akshay](https://avatars.discourse-cdn.com/v4/letter/a/3ab097/32.png) [@Akshay](https://support.prodi.gy/u/Akshay)\
**Post date:** [October 3, 2024, 6:08am UTC](https://support.prodi.gy/t/unable-to-use-classify-images/7404/1 "2024-10-03T06:08:31Z")

</div>

Hi,

I want to use multi-label image classification as described [here](https://prodi.gy/docs/computer-vision#classification-multi) in your docs.  
However, when I use:

> prodigy classify-images sunglasses\_brands ./images -F recipe.py

I get the following error:

> Traceback (most recent call last):  
> File "/usr/lib/python3.10/runpy.py", line 196, in \_run\_module\_as\_main  
> return \_run\_code(code, main\_globals, None,  
> File "/usr/lib/python3.10/runpy.py", line 86, in \_run\_code  
> exec(code, run\_globals)  
> File "...prodigy/lib/python3.10/site-packages/prodigy/ **main**.py", line 50, in   
> main()  
> File ".../prodigy/lib/python3.10/site-packages/prodigy/ **main**.py", line 44, in main  
> controller = run\_recipe(run\_args)  
> File "cython\_src/prodigy/cli.pyx", line 135, in prodigy.cli.run\_recipe  
> File "cython\_src/prodigy/core.pyx", line 155, in prodigy.core.Controller.from\_components  
> File "cython\_src/prodigy/core.pyx", line 307, in prodigy.core.Controller. **init**  
> File "cython\_src/prodigy/components/stream.pyx", line 191, in prodigy.components.stream.Stream.is\_empty  
> File "cython\_src/prodigy/components/stream.pyx", line 230, in prodigy.components.stream.Stream.peek  
> File "cython\_src/prodigy/components/stream.pyx", line 343, in prodigy.components.stream.Stream.\_get\_from\_iterator  
> File "cython\_src/prodigy/components/source.pyx", line 755, in load\_noop  
> File "cython\_src/prodigy/components/source.pyx", line 109, in **iter**  
> File "cython\_src/prodigy/components/source.pyx", line 110, in prodigy.components.source.Source. **iter**  
> File "cython\_src/prodigy/components/source.pyx", line 365, in read  
> File "... recipe.py", line 16, in get\_stream  
> stream = get\_stream(source)  
> TypeError: classify\_images..get\_stream() takes 0 positional arguments but 1 was given

Could you please help with the same?

Thanks,  
Akshay.

---

<div class="post-metadata">

**Author:** ![magdaaniol](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/magdaaniol/32/2787_2.png) [@magdaaniol](https://support.prodi.gy/u/magdaaniol)\
**Post date:** [October 4, 2024, 10:48am UTC](https://support.prodi.gy/t/unable-to-use-classify-images/7404/2 "2024-10-04T10:48:38Z")

</div>

Hi @Akshay,

I must admit there's en error in the example code which results in the naming conflict between the custom and the built-in `get_stream` function.

I have already edited the example in the docs, but here it is as well:

```python
import prodigy
from prodigy.components.stream import get_stream as prodigy_get_stream

OPTIONS = [
    {"id": 0, "text": "Ray Ban Wayfarer (Original)"},
    {"id": 1, "text": "Ray Ban Wayfarer (New)"},
    {"id": 2, "text": "Ray Ban Clubmaster (Classic)"},
    {"id": 3, "text": "Ray Ban Aviator (Classic)"},
    {"id": -1, "text": "Other model"}
]

@prodigy.recipe("classify-images")
def classify_images(dataset, source):
    def get_stream():
        # Load the directory of images and add options to each task
        stream = prodigy_get_stream(source)
        for eg in stream:
            eg["options"] = OPTIONS
            yield eg

    return {
        "dataset": dataset,
        "stream": get_stream(),
        "view_id": "choice",
        "config": {
            "choice_style": "single", # or "multiple"
            # Automatically accept and submit the answer if an option is
            # selected (only available for single-choice tasks)
            "choice_auto_accept": True
        }
    }

```

As you can see I renamed the built-in `get_stream` function in the import statement to avoid naming conflict in the recipe script.  
Apologies for that and many thanks for the heads-up that helped us to improve the docs!

---

<div class="post-metadata">

**Author:** ![Akshay](https://avatars.discourse-cdn.com/v4/letter/a/3ab097/32.png) [@Akshay](https://support.prodi.gy/u/Akshay)\
**Post date:** [October 5, 2024, 5:12am UTC](https://support.prodi.gy/t/unable-to-use-classify-images/7404/3 "2024-10-05T05:12:44Z")

</div>

Oh, I should have spotted that.  
Thank you for the resolution.
