ltttpku / CMMP

16 stars 1 forks source link

Getting erros running inference.py #10

Open YangJae96 opened 1 month ago

YangJae96 commented 1 month ago

Hi. Thank you for great work.

I am trying to run inference.py with command

python inference.py --index 8789 --pretrained checkpoints/detr-r50-hicodet.pth --use_insadapter --num_classes 117 --use_multi_hot --prompt_learning --LA --eval --resume [CKPT]

but facing so many problems like below.

CMMP/upt_tip_cache_model_free_finetune_distill3.py", line 610, in load_cache_model
print('[INFO]: missing idxs of verbs:', self.unseen_verb_idxs)
  File "/home/work/anaconda3/envs/pvic/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1269, in __getattr__
    raise AttributeError("'{}' object has no attribute '{}'".format(
AttributeError: 'UPT' object has no attribute 'unseen_verb_idxs'

I can't figure out how I should solve the problem.

Could I get some help.

ltttpku commented 2 weeks ago

Hi, could you please copy the argument parsing and model loading procedure from main_tip_finetune.py into inference.py?

YangJae96 commented 1 week ago
python inference.py --index 8789 --pretrained checkpoints/detr-r50-hicodet.pth --use_insadapter --num_classes 117 --use_multi_hot --prompt_learning --LA --eval --resume [CKPT]

Traceback (most recent call last): File "inference.py", line 23, in <module> from utils_tip_cache_and_union_finetune import custom_collate, CustomisedDLE, DataFactory File "/home/work/workplace/CMMP/utils_tip_cache_and_union_finetune.py", line 27, in <module> from hicodet.hicodet import HICODet File "/home/work/workplace/CMMP/hicodet/hicodet.py", line 15, in <module> from pocket.data import ImageDataset, DataSubset ModuleNotFoundError: No module named 'pocket.data'; 'pocket' is not a package

How should I setup pocket in my enviroment?

ltttpku commented 1 week ago

You can install the pocket package following this instruction.