Training completes but I can’t seem to use the generated model, but it
works with the ‘built-in’ params:
~/scratch/Gluon$ python3 demo_imagenet.py --model resnet18_v1 --input-pic ~/Pictures/sebastian-piton-goralski-gaudi3.jpg
The input picture is classified to be
[church], with probability 0.369.
[bell cote], with probability 0.351.
[castle], with probability 0.123.
[monastery], with probability 0.048.
[tile roof], with probability 0.029.
~/scratch/Gluon$ python3 demo_imagenet.py --model resnet18_v1 --input-pic ~/Pictures/sebastian-piton-goralski-gaudi3.jpg --saved-params params_resnet18_v1/0.2930-imagenet-resnet18_v1-118-best.params
The input picture is classified to be
Traceback (most recent call last):
File “demo_imagenet.py”, line 40, in
(net.classes[ind[i].asscalar()], nd.softmax(pred)[0][ind[i]].asscalar()))
AttributeError: ‘ResNetV1’ object has no attribute ‘classes’
~/scratch/Gluon$ python3 demo_imagenet.py --model resnet18_v1 --input-pic ~/Pictures/sebastian-piton-goralski-gaudi3.jpg --saved-params params_resnet18_v1/imagenet-resnet18_v1-119.params
The input picture is classified to be
Traceback (most recent call last):
File “demo_imagenet.py”, line 40, in
(net.classes[ind[i].asscalar()], nd.softmax(pred)[0][ind[i]].asscalar()))
AttributeError: ‘ResNetV1’ object has no attribute ‘classes’
What is imagenet_labels.txt for, is it silently referred to during training ? None of the scripts appear to refer to it, but would absence of this file during training cause this issue ?
From that version I just pasted in the class_names initialization and replaced the net.classes reference with class_names, and this lets me get results.