Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with AUC shuffled and NSS #3

Open
junting opened this issue Oct 19, 2016 · 2 comments
Open

Error with AUC shuffled and NSS #3

junting opened this issue Oct 19, 2016 · 2 comments

Comments

@junting
Copy link

junting commented Oct 19, 2016

Hello @matthias-k ,

I just find this error when I try to computed auc shuffled and nss.
aucs = self.AUC_per_image(stimuli, fixations, nonfixations=nonfixations, verbose=verbose) File "/home/env/local/lib/python2.7/site-packages/pysaliency/saliency_map_models.py", line 253, in AUC_per_image xs *= stimuli.sizes[n][1]/widths[other_ns] TypeError: Cannot cast ufunc multiply output from dtype('float64') to dtype('int64') with casting rule 'same_kind'

nss = my_model.NSSs(stimuli_salicon_val[0:50], fixations_salicon_val[fixations_salicon_val.n < 50],verbose=True) File "/home/env/local/lib/python2.7/site-packages/pysaliency/saliency_map_models.py", line 468, in NSSs _values -= mean TypeError: Cannot cast ufunc subtract output from dtype('float64') to dtype('uint8') with casting rule 'same_kind'

I think that the problem can be solved by adding
xs *= (stimuli.sizes[n][1]/widths[other_ns]).astype(xs.dtype)
For the both cases. Is that correct?

Cheers,
Junting

@junting
Copy link
Author

junting commented Oct 20, 2016

There is another error with NSS:
File "/home/env/local/lib/python2.7/site-packages/pysaliency/saliency_map_models.py", line 511, in NSSs _values /= std TypeError: ufunc 'true_divide' output (typecode 'd') could not be coerced to provided output parameter (typecode 'B') according to the casting rule ''same_kind''

@matthias-k
Copy link
Owner

Hi @junting,

pysaliency expects both saliency maps and fixation positions to be floats. Probably I should enforce that somewhere, but I am not really sure were to do so. I try to avoid astype as it might create a lot of unneccessary copies. I could check the saliency map dtype in SaliencyMapModel.saliency_map.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants