Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -17,7 +17,7 @@ model = models.resnet50()
17
  model.fc = torch.nn.Linear(model.fc.in_features, len(class_labels)) # len(class_labels) = 7
18
 
19
  # Cargar los pesos del modelo
20
- model.load_state_dict(torch.load("pytorch_model.bin"))
21
  model.eval()
22
 
23
  # Preprocesamiento de imágenes
 
17
  model.fc = torch.nn.Linear(model.fc.in_features, len(class_labels)) # len(class_labels) = 7
18
 
19
  # Cargar los pesos del modelo
20
+ model.load_state_dict(torch.load("pytorch_model.bin", map_location=torch.device('cpu')))
21
  model.eval()
22
 
23
  # Preprocesamiento de imágenes