Jzy2017 / TACL

TIP 2022 | Twin Adversarial Contrastive Learning for Underwater Image Enhancement and Beyond.
48 stars 4 forks source link

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

Open 0Error0Warning opened 6 months ago

0Error0Warning commented 6 months ago

作者好!当我使用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 commented 6 months ago

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

0Error0Warning commented 6 months ago

感谢您的回复,完整的报错信息如下 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 commented 6 months ago

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