Hi ,I’m trying to load model use model = torch.load(‘cnn4mnist.pt 28’), but I got error below:
Traceback (most recent call last):
  File "predict.py", line 11, in <module>
    model = torch.load('cnn4mnist.pt')
  File "C:\Users\kanch\Anaconda3\lib\site-packages\torch\serialization.py", line 231, in load
    return _load(f, map_location, pickle_module)
  File "C:\Users\kanch\Anaconda3\lib\site-packages\torch\serialization.py", line 379, in _load
    result = unpickler.load()
AttributeError: Can't get attribute 'CNN4MNIST' on <module '__main__' from 'predict.py'>

What should I do? I don’t really know where did I wrong?