junyanz / pytorch-CycleGAN-and-pix2pix

Image-to-Image Translation in PyTorch
Other
22.8k stars 6.29k forks source link

WHy is there no latest_net_G.pth in checkpoints folder? #1541

Open jcgit786 opened 1 year ago

jcgit786 commented 1 year ago

When I train my own custom dataset, I am getting this error: FileNotFoundError: [Errno 2] No such file or directory: './checkpoints/flir_v2ir/latest_net_G.pth'. Any ideas?

This is the full error message: Traceback (most recent call last): File "train.py", line 34, in model.setup(opt) # regular setup: load and print networks; create schedulers File "/content/drive/MyDrive/pytorch-CycleGAN-and-pix2pix-master/models/base_model.py", line 88, in setup self.load_networks(load_suffix) File "/content/drive/MyDrive/pytorch-CycleGAN-and-pix2pix-master/models/base_model.py", line 192, in load_networks state_dict = torch.load(load_path, map_location=str(self.device)) File "/usr/local/lib/python3.8/dist-packages/torch/serialization.py", line 771, in load with _open_file_like(f, 'rb') as opened_file: File "/usr/local/lib/python3.8/dist-packages/torch/serialization.py", line 270, in _open_file_like return _open_file(name_or_buffer, mode) File "/usr/local/lib/python3.8/dist-packages/torch/serialization.py", line 251, in init super(_open_file, self).init(open(name, mode)) FileNotFoundError: [Errno 2] No such file or directory: './checkpoints/flir_v2ir/latest_net_G.pth'

AlicanAKCA commented 1 year ago

Hey, the latest models are being saved as latest_model_G_A...

You should check out the names first. Then you can change their names.

I hope this helps.