Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no such file or directory:"./checkpoints/underwater/latest_net_G.pth' #9

Open
0Error0Warning opened this issue Apr 11, 2024 · 3 comments

Comments

@0Error0Warning
Copy link

作者好!当我使用readme中的指令“python test.py --dataroot ./datasets/[YOUR-DATASETS] --name underwater --model cycle_gan”进行测试时,程序报错“no such file or directory:"./checkpoints/underwater/latest_net_G.pth'”。
我注意到你们提供了latest_net_G_A.pth和latest_net_G_B.pth,但是没有测试所需的latest_net_G.pth,请问能够提供呢?在此表示感谢!

@Ysz2022
Copy link
Collaborator

Ysz2022 commented Apr 11, 2024

你方便发下完整的报错信息吗

@0Error0Warning
Copy link
Author

感谢您的回复,完整的报错信息如下
Warning: wandb package cannot be found. The option "--use_wandb" will result in error.
----------------- Options ---------------
aspect_ratio: 1.0
batch_size: 1
checkpoints_dir: ./checkpoints
crop_size: 300
dataroot: ./datasets/
dataset_mode: single
direction: AtoB
display_winsize: 300
epoch: latest
eval: False
gpu_ids: 0
init_gain: 0.02
init_type: normal
input_nc: 3
isTrain: False [default: None]
load_iter: 0 [default: 0]
load_size: 300
max_dataset_size: inf
model: test
model_suffix:
n_layers_D: 3
name: underwater
ndf: 64
netD: basic
netG: resnet_9blocks
ngf: 64
no_dropout: False
no_flip: False
norm: instance
num_test: 50
num_threads: 4
output_nc: 3
phase: test
preprocess: none
results_dir: ./results/
serial_batches: False
suffix:
use_wandb: False
verbose: False
wandb_project_name: CycleGAN-and-pix2pix
----------------- End -------------------
dataset [SingleDataset] was created
initialize network with normal
model [TestModel] was created
loading the model from ./checkpoints/underwater/latest_net_G.pth
Traceback (most recent call last):
File "test.py", line 19, in
model.setup(opt) # regular setup: load and print networks; create schedulers
File "/home/vcl/szg/TACL/models/base_model.py", line 88, in setup
self.load_networks(load_suffix)
File "/home/vcl/szg/TACL/models/base_model.py", line 192, in load_networks
state_dict = torch.load(load_path, map_location=str(self.device))
File "/home/vcl/anaconda3/envs/rs-gan/lib/python3.8/site-packages/torch/serialization.py", line 998, in load
with _open_file_like(f, 'rb') as opened_file:
File "/home/vcl/anaconda3/envs/rs-gan/lib/python3.8/site-packages/torch/serialization.py", line 445, in _open_file_like
return _open_file(name_or_buffer, mode)
File "/home/vcl/anaconda3/envs/rs-gan/lib/python3.8/site-packages/torch/serialization.py", line 426, in init
super().init(open(name, mode))
FileNotFoundError: [Errno 2] No such file or directory: './checkpoints/underwater/latest_net_G.pth'

@Ysz2022
Copy link
Collaborator

Ysz2022 commented Apr 11, 2024

你的load_path参数是什么?没有latest_net_G.pth模型,只有latest_net_G_A.pth和latest_net_G_B.pth

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants