Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'NoneType' object has no attribute 'num_classes' #8

Open
Rahul-Venugopal opened this issue Apr 30, 2019 · 1 comment

Comments

@Rahul-Venugopal
Copy link

Rahul-Venugopal commented Apr 30, 2019

Hi ,

I am running

python demo_image.py --image_name 'ILSVRC2012_val_00000004.JPEG'

and I am getting an error

Namespace(image_name='ILSVRC2012_val_00000004.JPEG', img_dir='examples/', input_size=321, num_classes=1000, save_dir='examples/results/', save_spg_c=True, snapshots='snapshots/imagenet_epoch_2_glo_step_128118.pth.tar', top_k=1)
Traceback (most recent call last):
  File "demo_image.py", line 69, in <module>
    model = load_model(args)
  File "demo_image.py", line 39, in load_model
    model = inceptionv3_spg.Inception3(num_classes=args.num_classes, threshold=0.5)
  File "/home/rahul/ActiveShuttle/WSOL/ACOL_SPG/SPG-master/models/google/inception3_spg.py", line 93, in __init__
    self.num_classes = args.num_classes
AttributeError: 'NoneType' object has no attribute 'num_classes'

Can anyone please help to find the problem ?

Thanks
Rahul

@halbielee
Copy link

You might solve the problem.

self.num_classes = args.num_classes

This line should be modified into

self.num_classes = num_classes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants