PartialLabelingCSL icon indicating copy to clipboard operation
PartialLabelingCSL copied to clipboard

inference not running

Open jmayank23 opened this issue 3 years ago • 3 comments

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 avatar Feb 11 '22 09:02 jmayank23

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

Is there a reason for that?

jmayank23 avatar Feb 11 '22 10:02 jmayank23

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

jmayank23 avatar Feb 11 '22 10:02 jmayank23

Have you solved the question?

rookietyper avatar May 30 '23 13:05 rookietyper