xk-huang / segment-caption-anything

[CVPR 24] The repository provides code for running inference and training for "Segment and Caption Anything" (SCA) , links for downloading the trained model checkpoints, and example notebooks / gradio demo that show how to use the model.
https://xk-huang.github.io/segment-caption-anything/
Apache License 2.0
204 stars 7 forks source link

omegaconf union error when running demo #8

Closed claraxfee closed 4 months ago

claraxfee commented 4 months ago

Hi!

I keep getting this error when trying to run your gradio demo (sca_app.py).

Environment:

Unfortunately, still can't run the gradio demo---keep getting this error:

File "/users/cfee/.local/lib/python3.9/site-packages/omegaconf/_utils.py", line 797, in _raise
    raise ex.with_traceback(sys.exc_info()[2])  # set env var OC_CAUSE=1 for full trace
omegaconf.errors.ConfigValueError: Unions of containers are not supported:
lr_scheduler_kwargs: Union[dict, str]
    full_key: 
    object_type=None

Checked in arguments.py and I see there are some comments about omegaconf not supporting Union:

@dataclass
class _Seq2SeqTrainingArguments(Seq2SeqTrainingArguments):
    # OmegaConf doesn't support Union, so we need to use Any
    # version 4.32.0
    debug: Any
    fsdp: Any
    # version 4.30.2
    generation_config: Any
    # version 4.36.2
    neftune_noise_alpha: Any = None
    sharded_ddp: Any = ""  # Removed in 4.36.2

Was trying to track this down and found this maybe related github issue if that's helpful

Can also provide full stack trace / any more info about my setup if needed

Please let me know how I can fix this--thanks very much in advance!

xk-huang commented 4 months ago

Hi @claraxfee ,

It seems that you use local environment and there is a conflict when installing the packages via conda and pip.

The problem is unsovlable unless you use docker or manually figure out the dependency tree for your system and hardware.

Thus I would like to recommend you to use docker.

FYI https://github.com/xk-huang/segment-caption-anything/issues/7