I trained a resnet34 model using mainModel.py on my image sets. However, when I tried to evalue its acurracy, I met the following problem.
I first create a model
model = models.dict’resnet34’
Then I loaded the model
# create new OrderedDict that does not contain
from collections import OrderedDict
new_checkpoint = OrderedDict()
for k, v in checkpoint.items():
name = k[7:] # remove
new_checkpoint[name] = v
However I got the following error message
Traceback (most recent call last):
File “testAccuracy.py”, line 94, in
Anyone can tell me what is the problem and how to fix it?
Thanks in advance!