Can't use `/mnt/<drive letter>/.cache` as cache dir

Using WSL2
In jupyter notebook.
When using diffusers’ pre-trained models, I get error when changing cache_dir to be /mnt/s/.cache. It does work for folders on /home/username

example:

pipe = StableDiffusionPipeline.from_pretrained("CompVis/stable-diffusion-v1-4",
                                               revision="fp16", torch_dtype=torch.float16,use_auth_token=True)

This works fine.

But this will fail:

pipe = StableDiffusionPipeline.from_pretrained("CompVis/stable-diffusion-v1-4",
                                               revision="fp16", torch_dtype=torch.float16,use_auth_token=True,
                                                cache_dir="/mnt/s/.cache")

I get OSError: Can't load config for 'CompVis/stable-diffusion-v1-4'. If you were trying to load it from 'https://huggingface.co/models', make sure you don't have a local directory with the same name. Otherwise, make sure 'CompVis/stable-diffusion-v1-4' is the correct path to a directory containing a model_index.json file

I checked for permissions and everything is 777, also Path('/mnt/s/foo').mkdir() worked fine.

1 Like