MedARC-AI / fMRI-reconstruction-NSD

fMRI-to-image reconstruction on the NSD dataset.
MIT License
294 stars 39 forks source link

Versatile Diffusion setup doesn't account for cached file structure #27

Open reesekneeland opened 12 months ago

reesekneeland commented 12 months ago

Hello,

When running first time setup and specifying the vd_cache path, the code is not setup to handle the resulting file structure from the diffusers checkpoint download, producing the following error:

Traceback (most recent call last): File "/export/raid1/home/kneel027/fMRI-reconstruction-NSD/src/Reconstructions.py", line 199, in <module> vd_pipe.scheduler = UniPCMultistepScheduler.from_pretrained(vd_cache_dir, subfolder="scheduler") File "/export/raid1/home/kneel027/miniconda3/envs/mindeye/lib/python3.10/site-packages/diffusers/schedulers/scheduling_utils.py", line 139, in from_pretrained config, kwargs = cls.load_config( File "/export/raid1/home/kneel027/miniconda3/envs/mindeye/lib/python3.10/site-packages/diffusers/configuration_utils.py", line 320, in load_config raise EnvironmentError( OSError: Error no file named scheduler_config.json found in directory ../versatile_diffusion.

I had to correct the path used to load the scheduler from: vd_pipe.scheduler = UniPCMultistepScheduler.from_pretrained(vd_cache_dir, subfolder="scheduler")

to the following to get it to load my downloaded checkpoint properly:

vd_pipe.scheduler = UniPCMultistepScheduler.from_pretrained(vd_cache_dir + "/models--shi-labs--versatile-diffusion/snapshots/2926f8e11ea526b562cd592b099fcf9c2985d0b7", subfolder="scheduler")