Dwight_Foster:

model.load_state_dict(torch.load(‘VA2.pth’))
# and then the forward pass
output = model(input)



I did as you suggested but I had to modify the head of the class to include
class CNNModel1():
def init(self, fully_layer_1=512, fully_layer_2=256, drop_rate=0.5):
Then I included at the end your lines of code and obtain
runfile(‘C:/- DOCKING/Macros/py/inouts/pthModels/pthModels.py’, wdir=‘C:/- DOCKING/Macros/py/inouts/pthModels’)
<main.CNNModel1 object at 0x000000522AA4D888>
Traceback (most recent call last):
File “C:- DOCKING\Macros\py\inouts\pthModels\pthModels.py”, line 60, in 
model.load_state_dict(torch.load(‘VA2.pth’))
AttributeError: ‘CNNModel1’ object has no attribute ‘load_state_dict’
The most I read, the most I do not understand what I am doing, nor why !