Skip to content

can only concatenate str (not "list") to str #453

@ShlomiRex

Description

@ShlomiRex

I'm trying to run the example for laion-400m dataset (https://github.com/rom1504/img2dataset/blob/main/dataset_examples/laion400m.md):

img2dataset --url_list laion400m-meta --input_format "parquet"\
         --url_col "URL" --caption_col "TEXT" --output_format webdataset\
           --output_folder laion400m-data --processes_count 16 --thread_count 128 --image_size 256\
             --save_additional_columns '["NSFW","similarity","LICENSE"]' --enable_wandb True

But I get the following error:

C:\Users\Shlomi\AppData\Local\Programs\Python\Python312\Lib\site-packages\albumentations\__init__.py:24: UserWarning: A new version of Albumentations is available: 2.0.5 (you have 1.4.24). Upgrade using: pip install -U albumentations. To disable automatic update checks, set the environment variable NO_ALBUMENTATIONS_UPDATE to 1.
  check_for_updates()
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\Shlomi\AppData\Local\Programs\Python\Python312\Scripts\img2dataset.exe\__main__.py", line 7, in <module>
  File "C:\Users\Shlomi\AppData\Local\Programs\Python\Python312\Lib\site-packages\img2dataset\main.py", line 276, in main
    fire.Fire(download)
  File "C:\Users\Shlomi\AppData\Local\Programs\Python\Python312\Lib\site-packages\fire\core.py", line 141, in Fire
    component_trace = _Fire(component, args, parsed_flag_args, context, name)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Shlomi\AppData\Local\Programs\Python\Python312\Lib\site-packages\fire\core.py", line 475, in _Fire
    component, remaining_args = _CallAndUpdateTrace(
                                ^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Shlomi\AppData\Local\Programs\Python\Python312\Lib\site-packages\fire\core.py", line 691, in _CallAndUpdateTrace
    component = fn(*varargs, **kwargs)
                ^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Shlomi\AppData\Local\Programs\Python\Python312\Lib\site-packages\img2dataset\main.py", line 184, in download
    reader = Reader(
             ^^^^^^^
  File "C:\Users\Shlomi\AppData\Local\Programs\Python\Python312\Lib\site-packages\img2dataset\reader.py", line 71, in __init__
    self.column_list = self.column_list + ["caption"]
                       ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
TypeError: can only concatenate str (not "list") to str

And then the program stops.

img2dataset version: 1.45.0
pip version: 25.0.1
python version: 3.12.7

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions