Alibaba-MIIL / PartialLabelingCSL

Official implementation for the paper: "Multi-label Classification with Partial Annotations using Class-aware Selective Loss"
MIT License
129 stars 18 forks source link

inference not running #8

Open jmayank23 opened 2 years ago

jmayank23 commented 2 years ago

I get the following error when running infer.py

Inference demo with CSL model Creating and loading the model... Traceback (most recent call last): File "infer.py", line 112, in <module> main() File "infer.py", line 68, in main model = create_model(args).cuda() File "/content/PartialLabelingCSL/src/models/utils/factory.py", line 11, in create_model model_params = {'args': args, 'num_classes': args.num_classes} AttributeError: 'Namespace' object has no attribute 'num_classes'

Command to reproduce - python infer.py \ --dataset_type=OpenImages \ --model_name=tresnet_m \ --model_path=/content/drive/MyDrive/mtresnet_opim_86.72.pth \ --pic_path=/content/wildlife-painting-art-500x500.jpeg \ --input_size=224

jmayank23 commented 2 years ago

I noticed the following line was commented in infer.py args.num_classes = state['num_classes']

Is there a reason for that?

jmayank23 commented 2 years ago

When I print state['num_classes'] I get 9605, how can I see a list of these class names?

rookietyper commented 1 year ago

Have you solved the question?