Paranioar / SGRAF

[AAAI2021] The code of “Similarity Reasoning and Filtration for Image-Text Matching”
214 stars 36 forks source link

evaluate.py does not run with models provided - get error from numpy array copy #14

Closed jkent42 closed 1 year ago

jkent42 commented 2 years ago

Attempted to run evaluation.py using provided MS Coco models.

cpu (ie non-gpu) version of Python 3.6 branch

In evaluation.py, line 103, appears to be attempting to insert a record into array img_embs

Specific line is

img_embs[ids] = img_emb.data.cpu().numpy().copy()

This line throws an Error:

IndexError: too many indices for array

Using provided code (evaluation.py) and MS Coco models, ids appears to be a tuple which prints as a list of integers

img_emb.data is a Tensor object, so the assignment to a numpy array img_embs appears to be an attempted conversion of a Tensor to a numpy array, however, the actual intent of the assignment and a work-around for the Error is unclear

Its documented code and the results from the associated paper are good, but unfortunately the provided models are not working, and do not allow the paper results to be duplicated

Please publish an update to the code which works with provided MS Coco models

I am out of my depth in attempting to update this code.

Paranioar commented 1 year ago

Please refer to the issue5.

jkent42 commented 1 year ago

Hello Professor,I did not know that this issue was still a problem for some people. I took your advice and reconfigured my environment to be based on python 2.7. I used only 2.7-compatible components. My errors went away. My lesson learned is to read the notes, and work with the listed prerequisites. The objective is to run the existing code. Porting to another environment is not the project. Thank you very much for your helpful feedback. KentSent from my iPhoneOn Dec 3, 2022, at 12:29 AM, Haiwen Diao @.***> wrote: Closed #14 as completed.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>