YuxinWenRick / tree-ring-watermark

MIT License
250 stars 32 forks source link

ValueError: /home/xin/./cache/trk/current_org does not exist. Make sure to run `trk.setup_repo(...)` first. #23

Closed Xin-Ray closed 8 months ago

Xin-Ray commented 8 months ago

Hi, this is Xin. I am interested in your contribution to watermark, greak work! when I run the "target_api.py"in src/tree_ring_watermark , several issue happend. So I upgrade my transformer, pytorch and diffuser to the latest version. But still I got this error below, could you please help me?


ValueError Traceback (most recent call last) Cell In[1], line 30 27 pipe = pipe.to(device) 29 shape = (1, 4, 64, 64) ---> 30 latents, w_key, w_mask = get_noise(shape, pipe) 32 watermarked_image = pipe(prompt="an astronaut", latents=latents).images[0] 34 is_watermarked = detect(watermarked_image, pipe, w_key, w_mask)

File ~/water_mark/treering_wk/tree-ring-watermark/src/tree_ring_watermark/_get_noise.py:81, in get_noise(shape, model_hash, generator) 78 file_path = os.path.join(temp_dir, file_name) 79 np.save(file_path, w_key) ---> 81 org = get_org() 82 repo_id = os.path.join(org, model_hash) 84 api.create_repo(repo_id=repo_id, exist_ok=True, repo_type="dataset")

File ~/water_mark/treering_wk/tree-ring-watermark/src/tree_ring_watermark/utils.py:24, in get_org() 21 file_path = os.path.join(CACHE_PATH, FILE_PATH) 23 if not os.path.isfile(file_path): ---> 24 raise ValueError(f"{file_path} does not exist. Make sure to run trk.setup_repo(...) first.") 25 with open(file_path, 'r') as file: 26 current_org = file.read()

ValueError: /home/xin/./cache/trk/current_org does not exist. Make sure to run trk.setup_repo(...) first.

YuxinWenRick commented 8 months ago

Hi Xin, could you do trk.set_org("trk-demo") first? The details can be found here. Also, I would recommend you run it with the older version of diffusers, as mentioned here.

Xin-Ray commented 8 months ago

thanks for your reply, I have another problem related to model authentication but i didn't find the way to solve this

  from .autonotebook import tqdm as notebook_tqdm
/home/xin/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/diffusers/utils/outputs.py:63: UserWarning: torch.utils._pytree._register_pytree_node is deprecated. Please use torch.utils._pytree.register_pytree_node instead.
  torch.utils._pytree._register_pytree_node(
Cannot initialize model with low cpu memory usage because `accelerate` was not found in the environment. Defaulting to `low_cpu_mem_usage=False`. It is strongly recommended to install `accelerate` for faster and less memory-intense model loading. You can do so with: 
`
pip install accelerate
`
.
Loading pipeline components...: 100%|██████████| 6/6 [00:06<00:00,  1.12s/it]
---------------------------------------------------------------------------
HTTPError                                 Traceback (most recent call last)
File [~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/huggingface_hub/utils/_errors.py:304](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/huggingface_hub/utils/_errors.py:304), in hf_raise_for_status(response, endpoint_name)
    [303](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/huggingface_hub/utils/_errors.py:303) try:
--> [304](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/huggingface_hub/utils/_errors.py:304)     response.raise_for_status()
    [305](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/huggingface_hub/utils/_errors.py:305) except HTTPError as e:

File [~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/requests/models.py:1021](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/requests/models.py:1021), in Response.raise_for_status(self)
   [1020](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/requests/models.py:1020) if http_error_msg:
-> [1021](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/requests/models.py:1021)     raise HTTPError(http_error_msg, response=self)

HTTPError: 403 Client Error: Forbidden for url: https://huggingface.co/api/repos/create

The above exception was the direct cause of the following exception:

HfHubHTTPError                            Traceback (most recent call last)
File [~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/huggingface_hub/hf_api.py:3352](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/huggingface_hub/hf_api.py:3352), in HfApi.create_repo(self, repo_id, token, private, repo_type, exist_ok, space_sdk, space_hardware, space_storage, space_sleep_time, space_secrets, space_variables)
   [3351](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/huggingface_hub/hf_api.py:3351) try:
-> [3352](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/huggingface_hub/hf_api.py:3352)     hf_raise_for_status(r)
   [3353](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/huggingface_hub/hf_api.py:3353) except HTTPError as err:

File [~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/huggingface_hub/utils/_errors.py:362](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/huggingface_hub/utils/_errors.py:362), in hf_raise_for_status(response, endpoint_name)
    [360](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/huggingface_hub/utils/_errors.py:360) # Convert `HTTPError` into a `HfHubHTTPError` to display request information
    [361](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/huggingface_hub/utils/_errors.py:361) # as well (request id and/or server error message)
--> [362](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/huggingface_hub/utils/_errors.py:362) raise HfHubHTTPError(str(e), response=response) from e

HfHubHTTPError: 403 Client Error: Forbidden for url: https://huggingface.co/api/repos/create (Request ID: Root=1-65e5eebf-5954dcc46ca45bdf3a83ab30;4ee0bd95-062f-4777-a49f-cd2610d1bdd7)

You don't have the rights to create a dataset under this namespace

During handling of the above exception, another exception occurred:

HTTPError                                 Traceback (most recent call last)
File [~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/huggingface_hub/utils/_errors.py:304](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/huggingface_hub/utils/_errors.py:304), in hf_raise_for_status(response, endpoint_name)
    [303](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/huggingface_hub/utils/_errors.py:303) try:
--> [304](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/huggingface_hub/utils/_errors.py:304)     response.raise_for_status()
    [305](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/huggingface_hub/utils/_errors.py:305) except HTTPError as e:

File [~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/requests/models.py:1021](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/requests/models.py:1021), in Response.raise_for_status(self)
   [1020](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/requests/models.py:1020) if http_error_msg:
-> [1021](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/requests/models.py:1021)     raise HTTPError(http_error_msg, response=self)

HTTPError: 404 Client Error: Not Found for url: https://huggingface.co/api/datasets/trk-demo/StableDiffusionPipeline

The above exception was the direct cause of the following exception:

RepositoryNotFoundError                   Traceback (most recent call last)
Cell In[1], [line 32](vscode-notebook-cell:?execution_count=1&line=32)
     [29](vscode-notebook-cell:?execution_count=1&line=29) pipe = pipe.to(device)
     [31](vscode-notebook-cell:?execution_count=1&line=31) shape = (1, 4, 64, 64)
---> [32](vscode-notebook-cell:?execution_count=1&line=32) latents, w_key, w_mask = trk.get_noise(shape, 'StableDiffusionPipeline')
     [34](vscode-notebook-cell:?execution_count=1&line=34) watermarked_image = pipe(prompt="an astronaut", latents=latents).images[0]
     [36](vscode-notebook-cell:?execution_count=1&line=36) is_watermarked = detect(watermarked_image, pipe, w_key, w_mask)

File [~/water_mark/treering_wk/tree-ring-watermark/src/tree_ring_watermark/_get_noise.py:84](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/water_mark/treering_wk/tree-ring-watermark/src/tree_ring_watermark/_get_noise.py:84), in get_noise(shape, model_hash, generator)
     [81](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/water_mark/treering_wk/tree-ring-watermark/src/tree_ring_watermark/_get_noise.py:81) org = get_org()
     [82](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/water_mark/treering_wk/tree-ring-watermark/src/tree_ring_watermark/_get_noise.py:82) repo_id = os.path.join(org, model_hash)
---> [84](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/water_mark/treering_wk/tree-ring-watermark/src/tree_ring_watermark/_get_noise.py:84) api.create_repo(repo_id=repo_id, exist_ok=True, repo_type="dataset")
     [86](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/water_mark/treering_wk/tree-ring-watermark/src/tree_ring_watermark/_get_noise.py:86) api.upload_file(
     [87](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/water_mark/treering_wk/tree-ring-watermark/src/tree_ring_watermark/_get_noise.py:87)     path_or_fileobj=file_path,
     [88](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/water_mark/treering_wk/tree-ring-watermark/src/tree_ring_watermark/_get_noise.py:88)     path_in_repo=file_name,
     [89](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/water_mark/treering_wk/tree-ring-watermark/src/tree_ring_watermark/_get_noise.py:89)     repo_id=repo_id,
     [90](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/water_mark/treering_wk/tree-ring-watermark/src/tree_ring_watermark/_get_noise.py:90)     repo_type="dataset",
     [91](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/water_mark/treering_wk/tree-ring-watermark/src/tree_ring_watermark/_get_noise.py:91) )
     [93](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/water_mark/treering_wk/tree-ring-watermark/src/tree_ring_watermark/_get_noise.py:93) return init_latents

File [~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/huggingface_hub/utils/_validators.py:118](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/huggingface_hub/utils/_validators.py:118), in validate_hf_hub_args.<locals>._inner_fn(*args, **kwargs)
    [115](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/huggingface_hub/utils/_validators.py:115) if check_use_auth_token:
    [116](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/huggingface_hub/utils/_validators.py:116)     kwargs = smoothly_deprecate_use_auth_token(fn_name=fn.__name__, has_token=has_token, kwargs=kwargs)
--> [118](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/huggingface_hub/utils/_validators.py:118) return fn(*args, **kwargs)

File [~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/huggingface_hub/hf_api.py:3360](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/huggingface_hub/hf_api.py:3360), in HfApi.create_repo(self, repo_id, token, private, repo_type, exist_ok, space_sdk, space_hardware, space_storage, space_sleep_time, space_secrets, space_variables)
   [3357](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/huggingface_hub/hf_api.py:3357) elif exist_ok and err.response.status_code == 403:
   [3358](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/huggingface_hub/hf_api.py:3358)     # No write permission on the namespace but repo might already exist
   [3359](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/huggingface_hub/hf_api.py:3359)     try:
-> [3360](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/huggingface_hub/hf_api.py:3360)         self.repo_info(repo_id=repo_id, repo_type=repo_type, token=token)
   [3361](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/huggingface_hub/hf_api.py:3361)         if repo_type is None or repo_type == REPO_TYPE_MODEL:
   [3362](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/huggingface_hub/hf_api.py:3362)             return RepoUrl(f"{self.endpoint}/{repo_id}")

File [~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/huggingface_hub/utils/_validators.py:118](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/huggingface_hub/utils/_validators.py:118), in validate_hf_hub_args.<locals>._inner_fn(*args, **kwargs)
    [115](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/huggingface_hub/utils/_validators.py:115) if check_use_auth_token:
    [116](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/huggingface_hub/utils/_validators.py:116)     kwargs = smoothly_deprecate_use_auth_token(fn_name=fn.__name__, has_token=has_token, kwargs=kwargs)
--> [118](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/huggingface_hub/utils/_validators.py:118) return fn(*args, **kwargs)

File [~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/huggingface_hub/hf_api.py:2410](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/huggingface_hub/hf_api.py:2410), in HfApi.repo_info(self, repo_id, revision, repo_type, timeout, files_metadata, token)
   [2408](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/huggingface_hub/hf_api.py:2408) else:
   [2409](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/huggingface_hub/hf_api.py:2409)     raise ValueError("Unsupported repo type.")
-> [2410](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/huggingface_hub/hf_api.py:2410) return method(
   [2411](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/huggingface_hub/hf_api.py:2411)     repo_id,
   [2412](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/huggingface_hub/hf_api.py:2412)     revision=revision,
   [2413](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/huggingface_hub/hf_api.py:2413)     token=token,
   [2414](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/huggingface_hub/hf_api.py:2414)     timeout=timeout,
   [2415](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/huggingface_hub/hf_api.py:2415)     files_metadata=files_metadata,
   [2416](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/huggingface_hub/hf_api.py:2416) )

File [~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/huggingface_hub/utils/_validators.py:118](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/huggingface_hub/utils/_validators.py:118), in validate_hf_hub_args.<locals>._inner_fn(*args, **kwargs)
    [115](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/huggingface_hub/utils/_validators.py:115) if check_use_auth_token:
    [116](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/huggingface_hub/utils/_validators.py:116)     kwargs = smoothly_deprecate_use_auth_token(fn_name=fn.__name__, has_token=has_token, kwargs=kwargs)
--> [118](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/huggingface_hub/utils/_validators.py:118) return fn(*args, **kwargs)

File [~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/huggingface_hub/hf_api.py:2283](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/huggingface_hub/hf_api.py:2283), in HfApi.dataset_info(self, repo_id, revision, timeout, files_metadata, token)
   [2280](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/huggingface_hub/hf_api.py:2280)     params["blobs"] = True
   [2282](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/huggingface_hub/hf_api.py:2282) r = get_session().get(path, headers=headers, timeout=timeout, params=params)
-> [2283](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/huggingface_hub/hf_api.py:2283) hf_raise_for_status(r)
   [2284](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/huggingface_hub/hf_api.py:2284) data = r.json()
   [2285](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/huggingface_hub/hf_api.py:2285) return DatasetInfo(**data)

File [~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/huggingface_hub/utils/_errors.py:352](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/huggingface_hub/utils/_errors.py:352), in hf_raise_for_status(response, endpoint_name)
    [333](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/huggingface_hub/utils/_errors.py:333) elif error_code == "RepoNotFound" or (
    [334](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/huggingface_hub/utils/_errors.py:334)     response.status_code == 401
    [335](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/huggingface_hub/utils/_errors.py:335)     and response.request is not None
   (...)
    [342](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/huggingface_hub/utils/_errors.py:342)     # => for now, we process them as `RepoNotFound` anyway.
    [343](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/huggingface_hub/utils/_errors.py:343)     # See https://gist.github.com/Wauplin/46c27ad266b15998ce56a6603796f0b9
    [344](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/huggingface_hub/utils/_errors.py:344)     message = (
    [345](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/huggingface_hub/utils/_errors.py:345)         f"{response.status_code} Client Error."
    [346](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/huggingface_hub/utils/_errors.py:346)         + "\n\n"
   (...)
    [350](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/huggingface_hub/utils/_errors.py:350)         " make sure you are authenticated."
    [351](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/huggingface_hub/utils/_errors.py:351)     )
--> [352](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/huggingface_hub/utils/_errors.py:352)     raise RepositoryNotFoundError(message, response) from e
    [354](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/huggingface_hub/utils/_errors.py:354) elif response.status_code == 400:
    [355](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/huggingface_hub/utils/_errors.py:355)     message = (
    [356](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/huggingface_hub/utils/_errors.py:356)         f"\n\nBad request for {endpoint_name} endpoint:" if endpoint_name is not None else "\n\nBad request:"
    [357](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/huggingface_hub/utils/_errors.py:357)     )

RepositoryNotFoundError: 404 Client Error. (Request ID: Root=1-65e5eebf-61a2677e184bfdf22107520c;3656aa9b-8a43-47fc-a1a5-2993a137b8d6)

Repository Not Found for url: https://huggingface.co/api/datasets/trk-demo/StableDiffusionPipeline.
Please make sure you specified the correct `repo_id` and `repo_type`.
If you are trying to access a private or gated repo, make sure you are authenticated.

(I do want to use the diffuser that you recommend. But the diffusers==0.11.1 lack of ‘DDIMInverseScheduler’

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
Cell In[1], [line 5](vscode-notebook-cell:?execution_count=1&line=5)
      [2](vscode-notebook-cell:?execution_count=1&line=2) import torch
      [3](vscode-notebook-cell:?execution_count=1&line=3) import torchvision
----> [5](vscode-notebook-cell:?execution_count=1&line=5) from src import tree_ring_watermark as trk
      [6](vscode-notebook-cell:?execution_count=1&line=6) from diffusers import DPMSolverMultistepScheduler, DiffusionPipeline, DDIMScheduler
      [7](vscode-notebook-cell:?execution_count=1&line=7) from inverse_stable_diffusion import InversableStableDiffusionPipeline

File [~/water_mark/treering_wk/tree-ring-watermark/src/tree_ring_watermark/__init__.py:4](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/water_mark/treering_wk/tree-ring-watermark/src/tree_ring_watermark/__init__.py:4)
      [1](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/water_mark/treering_wk/tree-ring-watermark/src/tree_ring_watermark/__init__.py:1) __version__ = "0.0.2"
      [3](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/water_mark/treering_wk/tree-ring-watermark/src/tree_ring_watermark/__init__.py:3) from ._check import check
----> [4](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/water_mark/treering_wk/tree-ring-watermark/src/tree_ring_watermark/__init__.py:4) from ._detect import detect
      [5](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/water_mark/treering_wk/tree-ring-watermark/src/tree_ring_watermark/__init__.py:5) from ._get_noise import get_noise
      [6](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/water_mark/treering_wk/tree-ring-watermark/src/tree_ring_watermark/__init__.py:6) from .utils import set_org, get_org

File [~/water_mark/treering_wk/tree-ring-watermark/src/tree_ring_watermark/_detect.py:8](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/water_mark/treering_wk/tree-ring-watermark/src/tree_ring_watermark/_detect.py:8)
      [6](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/water_mark/treering_wk/tree-ring-watermark/src/tree_ring_watermark/_detect.py:6) from typing import Union
      [7](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/water_mark/treering_wk/tree-ring-watermark/src/tree_ring_watermark/_detect.py:7) from huggingface_hub import snapshot_download
----> [8](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/water_mark/treering_wk/tree-ring-watermark/src/tree_ring_watermark/_detect.py:8) from diffusers import DDIMInverseScheduler
      [9](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/water_mark/treering_wk/tree-ring-watermark/src/tree_ring_watermark/_detect.py:9) from .utils import get_org
     [10](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/water_mark/treering_wk/tree-ring-watermark/src/tree_ring_watermark/_detect.py:10) from ._get_noise import _circle_mask

ImportError: cannot import name 'DDIMInverseScheduler' from 'diffusers' (/home/xin/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/diffusers/__init__.py)

Besides, the transformers == 4.23.1 lack of ''CLIPTextModelWithProjection'':

/home/xin/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/tqdm/auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html
  from .autonotebook import tqdm as notebook_tqdm
/home/xin/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/diffusers/utils/outputs.py:63: UserWarning: torch.utils._pytree._register_pytree_node is deprecated. Please use torch.utils._pytree.register_pytree_node instead.
  torch.utils._pytree._register_pytree_node(
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
File [~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/diffusers/utils/import_utils.py:704](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/diffusers/utils/import_utils.py:704), in _LazyModule._get_module(self, module_name)
    [703](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/diffusers/utils/import_utils.py:703) try:
--> [704](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/diffusers/utils/import_utils.py:704)     return importlib.import_module("." + module_name, self.__name__)
    [705](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/diffusers/utils/import_utils.py:705) except Exception as e:

File [~/miniconda3/envs/water_mark_2/lib/python3.9/importlib/__init__.py:127](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/importlib/__init__.py:127), in import_module(name, package)
    [126](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/importlib/__init__.py:126)         level += 1
--> [127](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/importlib/__init__.py:127) return _bootstrap._gcd_import(name[level:], package, level)

File <frozen importlib._bootstrap>:1030, in _gcd_import(name, package, level)

File <frozen importlib._bootstrap>:1007, in _find_and_load(name, import_)

File <frozen importlib._bootstrap>:972, in _find_and_load_unlocked(name, import_)

File <frozen importlib._bootstrap>:228, in _call_with_frames_removed(f, *args, **kwds)

File <frozen importlib._bootstrap>:1030, in _gcd_import(name, package, level)

File <frozen importlib._bootstrap>:1007, in _find_and_load(name, import_)

File <frozen importlib._bootstrap>:986, in _find_and_load_unlocked(name, import_)

File <frozen importlib._bootstrap>:680, in _load_unlocked(spec)

File <frozen importlib._bootstrap_external>:790, in exec_module(self, module)

File <frozen importlib._bootstrap>:228, in _call_with_frames_removed(f, *args, **kwds)

File [~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/diffusers/models/autoencoders/__init__.py:1](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/diffusers/models/autoencoders/__init__.py:1)
----> [1](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/diffusers/models/autoencoders/__init__.py:1) from .autoencoder_asym_kl import AsymmetricAutoencoderKL
      [2](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/diffusers/models/autoencoders/__init__.py:2) from .autoencoder_kl import AutoencoderKL

File [~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/diffusers/models/autoencoders/autoencoder_asym_kl.py:23](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/diffusers/models/autoencoders/autoencoder_asym_kl.py:23)
     [22](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/diffusers/models/autoencoders/autoencoder_asym_kl.py:22) from ..modeling_utils import ModelMixin
---> [23](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/diffusers/models/autoencoders/autoencoder_asym_kl.py:23) from .vae import DecoderOutput, DiagonalGaussianDistribution, Encoder, MaskConditionDecoder
     [26](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/diffusers/models/autoencoders/autoencoder_asym_kl.py:26) class AsymmetricAutoencoderKL(ModelMixin, ConfigMixin):

File [~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/diffusers/models/autoencoders/vae.py:23](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/diffusers/models/autoencoders/vae.py:23)
     [22](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/diffusers/models/autoencoders/vae.py:22) from ...utils.torch_utils import randn_tensor
---> [23](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/diffusers/models/autoencoders/vae.py:23) from ..activations import get_activation
     [24](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/diffusers/models/autoencoders/vae.py:24) from ..attention_processor import SpatialNorm

File [~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/diffusers/models/activations.py:21](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/diffusers/models/activations.py:21)
     [20](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/diffusers/models/activations.py:20) from ..utils import USE_PEFT_BACKEND
---> [21](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/diffusers/models/activations.py:21) from .lora import LoRACompatibleLinear
     [24](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/diffusers/models/activations.py:24) ACTIVATION_FUNCTIONS = {
     [25](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/diffusers/models/activations.py:25)     "swish": nn.SiLU(),
     [26](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/diffusers/models/activations.py:26)     "silu": nn.SiLU(),
   (...)
     [29](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/diffusers/models/activations.py:29)     "relu": nn.ReLU(),
     [30](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/diffusers/models/activations.py:30) }

File [~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/diffusers/models/lora.py:35](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/diffusers/models/lora.py:35)
     [34](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/diffusers/models/lora.py:34) if is_transformers_available():
---> [35](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/diffusers/models/lora.py:35)     from transformers import CLIPTextModel, CLIPTextModelWithProjection
     [38](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/diffusers/models/lora.py:38) logger = logging.get_logger(__name__)  # pylint: disable=invalid-name

ImportError: cannot import name 'CLIPTextModelWithProjection' from 'transformers' (/home/xin/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/transformers/__init__.py)

The above exception was the direct cause of the following exception:

RuntimeError                              Traceback (most recent call last)
Cell In[1], [line 7](vscode-notebook-cell:?execution_count=1&line=7)
      [5](vscode-notebook-cell:?execution_count=1&line=5) from src import tree_ring_watermark as trk
      [6](vscode-notebook-cell:?execution_count=1&line=6) from diffusers import DPMSolverMultistepScheduler, DiffusionPipeline, DDIMScheduler
----> [7](vscode-notebook-cell:?execution_count=1&line=7) from inverse_stable_diffusion import InversableStableDiffusionPipeline
      [9](vscode-notebook-cell:?execution_count=1&line=9) # from _get_noise import get_noise
     [10](vscode-notebook-cell:?execution_count=1&line=10) # from _detect import detect
     [12](vscode-notebook-cell:?execution_count=1&line=12) from PIL import Image

File [~/water_mark/treering_wk/tree-ring-watermark/inverse_stable_diffusion.py:7](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/water_mark/treering_wk/tree-ring-watermark/inverse_stable_diffusion.py:7)
      [4](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/water_mark/treering_wk/tree-ring-watermark/inverse_stable_diffusion.py:4) import torch
      [5](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/water_mark/treering_wk/tree-ring-watermark/inverse_stable_diffusion.py:5) from transformers import CLIPFeatureExtractor, CLIPTextModel, CLIPTokenizer
----> [7](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/water_mark/treering_wk/tree-ring-watermark/inverse_stable_diffusion.py:7) from diffusers.models import AutoencoderKL, UNet2DConditionModel
      [8](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/water_mark/treering_wk/tree-ring-watermark/inverse_stable_diffusion.py:8) # from diffusers import StableDiffusionPipeline
      [9](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/water_mark/treering_wk/tree-ring-watermark/inverse_stable_diffusion.py:9) from diffusers.pipelines.stable_diffusion.safety_checker import \
     [10](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/water_mark/treering_wk/tree-ring-watermark/inverse_stable_diffusion.py:10)     StableDiffusionSafetyChecker

File <frozen importlib._bootstrap>:1055, in _handle_fromlist(module, fromlist, import_, recursive)

File [~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/diffusers/utils/import_utils.py:694](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/diffusers/utils/import_utils.py:694), in _LazyModule.__getattr__(self, name)
    [692](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/diffusers/utils/import_utils.py:692)     value = self._get_module(name)
    [693](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/diffusers/utils/import_utils.py:693) elif name in self._class_to_module.keys():
--> [694](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/diffusers/utils/import_utils.py:694)     module = self._get_module(self._class_to_module[name])
    [695](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/diffusers/utils/import_utils.py:695)     value = getattr(module, name)
    [696](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/diffusers/utils/import_utils.py:696) else:

File [~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/diffusers/utils/import_utils.py:706](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/diffusers/utils/import_utils.py:706), in _LazyModule._get_module(self, module_name)
    [704](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/diffusers/utils/import_utils.py:704)     return importlib.import_module("." + module_name, self.__name__)
    [705](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/diffusers/utils/import_utils.py:705) except Exception as e:
--> [706](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/diffusers/utils/import_utils.py:706)     raise RuntimeError(
    [707](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/diffusers/utils/import_utils.py:707)         f"Failed to import {self.__name__}.{module_name} because of the following error (look up to see its"
    [708](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/diffusers/utils/import_utils.py:708)         f" traceback):\n{e}"
    [709](https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/xin/water_mark/treering_wk/tree-ring-watermark/~/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/diffusers/utils/import_utils.py:709)     ) from e

RuntimeError: Failed to import diffusers.models.autoencoders.autoencoder_kl because of the following error (look up to see its traceback):
cannot import name 'CLIPTextModelWithProjection' from 'transformers' (/home/xin/miniconda3/envs/water_mark_2/lib/python3.9/site-packages/transformers/__init__.py)

so I upgrad the transformers and diffuser to latest version.)

YuxinWenRick commented 8 months ago

Hi Xin, sorry about it. I don't know what could be the better solution, but if you just want to reproduce the experiments from the paper, you can just follow this. Or, if you want to use it easily, maybe you can check out this new implementation by the community? Their implementation is compatible with the latest diffusers and transformers.

Xin-Ray commented 8 months ago

Thank you so much, I think the new implementation is awesome!!