junyanz / pytorch-CycleGAN-and-pix2pix

Image-to-Image Translation in PyTorch
Other
23.09k stars 6.32k forks source link

HELP: No such file or directory: './checkpoints\\maps_cyclegan\\latest_net_G.pth' #1578

Open tjnkyqcy opened 1 year ago

tjnkyqcy commented 1 year ago

All errors are reported as follows: Traceback (most recent call last): File "C:/Users/Administrator/Desktop/pytorch-CycleGAN-and-pix2pix-master/test.py", line 52, in model.setup(opt) # regular setup: load and print networks; create schedulers File "C:\Users\Administrator\Desktop\pytorch-CycleGAN-and-pix2pix-master\models\base_model.py", line 88, in setup self.load_networks(load_suffix) File "C:\Users\Administrator\Desktop\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 "E:\Anaconda3\envs\pytorch-gpu-Gan\lib\site-packages\torch\serialization.py", line 594, in load with _open_file_like(f, 'rb') as opened_file: File "E:\Anaconda3\envs\pytorch-gpu-Gan\lib\site-packages\torch\serialization.py", line 230, in _open_file_like return _open_file(name_or_buffer, mode) File "E:\Anaconda3\envs\pytorch-gpu-Gan\lib\site-packages\torch\serialization.py", line 211, in init super(_open_file, self).init(open(name, mode)) FileNotFoundError: [Errno 2] No such file or directory: './checkpoints\maps_cyclegan\latest_net_G.pth'

Here is the folder where I generated the model C:\Users\Administrator\Desktop\pytorch-CycleGAN-and-pix2pix-master\checkpoints\maps_cyclegan: -latest_net_D_A.pth -latest_net_D_B.pth -latest_net_G_A.pth -latest_net_G_B.pth There is no latest_net_G.pth in the program-generated model?

nuonuoxiangyaofeigaogao commented 1 year ago

Have you solved this question?

teejeepee97 commented 1 year ago

@nuonuoxiangyaofeigaogao @tjnkyqcy In https://github.com/junyanz/pytorch-CycleGAN-and-pix2pix/issues/233#issuecomment-379134078 it is mentioned that you need to manually change the name of the .pth file.