Junyi42 / sd-dino

Official Implementation of paper "A Tale of Two Features: Stable Diffusion Complements DINO for Zero-Shot Semantic Correspondence"
https://sd-complements-dino.github.io
271 stars 14 forks source link

ValueError: a must be greater than 0 unless no samples are taken #7

Closed murmurelo111 closed 1 year ago

murmurelo111 commented 1 year ago

Hi, I met the problem when I run pck_spair_pascal.py Would you mind to telling me how to fix the issue? Thanks! issue

murmurelo111 commented 1 year ago

image

Junyi42 commented 1 year ago

Hi @murmurelo111,

Could you share how many samples (the --SAMPLE argument) you are using currently? It looks like this error is due to trying to randomly sample 0 pairs, which should be avoided by this line.

Thanks.

murmurelo111 commented 1 year ago

Hi @murmurelo111,

Could you share how many samples (the --SAMPLE argument) you are using currently? It looks like this error is due to trying to randomly sample 0 pairs, which should be avoided by this line.

Thanks.

I uesd 20 image

Junyi42 commented 1 year ago

Hi @murmurelo111,

Thanks for the info. According to this issue, it is most likely that the pairs list is empty. Please check whether you have set the path to the dataset correctly.

Best.

murmurelo111 commented 1 year ago

Hi @murmurelo111,

Thanks for the info. According to this issue, it is most likely that the pairs list is empty. Please check whether you have set the path to the dataset correctly.

Best.

Thanks for reply! I have solved the problem by changing pairs = sorted(glob(f'{path}/PairAnnotation/{split}/*:{category}.json')) to pairs = sorted(glob(f'{path}/PairAnnotation/{split}/*_{category}.json'))