anguyen8/gScoreCAM

Run Error

Opened this issue · 1 comments

I meet this problems when I run python visualize_cam.py --cam-version gscorecam --image-folder data-coco/

Traceback (most recent call last):
File "/home/xiuyu/Weiran_MadSam/gScoreCAM-main/visualize_cam.py", line 32, in
class CLIPIntereactiveCAM:
File "/home/xiuyu/Weiran_MadSam/gScoreCAM-main/visualize_cam.py", line 200, in CLIPIntereactiveCAM
def get_gt_boxes(self, input_text: str, image_id: int) -> List[List[float, float, float, float]]:
File "/home/xiuyu/anaconda3/envs/gscorecam/lib/python3.9/typing.py", line 277, in inner
return func(*args, **kwds)
File "/home/xiuyu/anaconda3/envs/gscorecam/lib/python3.9/typing.py", line 838, in getitem
_check_generic(self, params, self._nparams)
File "/home/xiuyu/anaconda3/envs/gscorecam/lib/python3.9/site-packages/typing_extensions.py", line 113, in _check_generic
raise TypeError(f"Too {'many' if alen > elen else 'few'} parameters for {cls};"
TypeError: Too many parameters for typing.List; actual 4, expected 1

Is this because of the installation package version issue, or is it something else? Thanks

I was having the same issue.

Changing line 200 in visualize_cam.py to def get_gt_boxes(self, input_text: str, image_id: int) -> List[List[float]]: worked for me