ekosman / AnomalyDetectionCVPR2018-Pytorch

Pytorch version of - https://github.com/WaqasSultani/AnomalyDetectionCVPR2018
172 stars 52 forks source link

Loading a checkpoint when running TrainingAnomalyDetector_public #173

Closed SkyWalkerJJJ closed 1 year ago

SkyWalkerJJJ commented 1 year ago

When I load an existed checkpoint this line, an error shows below. My question is should the code define something as network = AnomalyDetector(args.feature_dim) model = TorchModel.load_model(args.checkpoint)

Not really sure about the coding structure of TorchModel, so I want to confirm with you is it right to add network = AnomalyDetector(args.feature_dim) before it, and it will work perfectly?

Traceback (most recent call last):
  File "train_anomaly_detector.py", line 153, in <module>
    criterion = RegularizedLoss(network, custom_objective).to(device)
NameError: name 'network' is not defined
ekosman commented 1 year ago

Definitely! Thanks for reporting this. I will fix it soon. Can you check if training under the branch bugfix/model_checkpoint works?