If you store a model directly via torch.save(model, file_path), you would need to restore the file and folder structure in order to load this model again as explained here.
Based on the error message it seems that some files with the network definition are missing.
If you are using this approach: model = torch.load(path), you would need to make sure that all necessary files are in the corresponding folders as they were while storing the model.
The other approach of creating the model first and load the state_dict is more flexible, as you might change the actual file and folder structure and would just have to make sure to create a model with matching parameters.
@Oscar_Rangel I encountered the same problem a few days ago. You have to replicate the model github directory structure to be able to open the file. To avoid that in the future, you can save the model’s state_dict instead. Below is how I solved the error:
Therefore, you need to build a folder named network and then copy models.py and xception.py from FF++, then you can import the model file. Remember to add init.py then you can import these two files without an absolute path.
Follow the guideline in this repo (GitHub - paarthneekhara/AdversarialDeepFakes), you have to download the .zip file and extract it from the directory that already has the network folder