想问一下作者训练的时候采用的图片尺寸是多大的,为什么我直接用代码里面提供训练好的模型进行测试,发现报错,但是之前测试成功了,只是采用的测试数据集不同,其他什么都没有变动,现实报错。
(LF_38) [[38;5;83mlenovo@thinkstationp520:/mnt/student/2023Students/ZXR/LF_Font$ python evaluator.py \
cfgs/factorize.yaml \
--weight /mnt/student/2023Students/ZXR/LF_Font/weight/generator.pth \
--img_dir results/sinkai/images \
--test_meta /mnt/student/2023Students/ZXR/LF_Font/output/sinkai/meta/test_chuli.json \
--data_path /mnt/student/2023Students/ZXR/LF_Font/output/sinkai/lmdb
failed to import apex
INFO::04/20 22:12:13 | Resumed checkpoint from /mnt/student/2023Students/ZXR/LF_Font/weight/generator.pth
INFO::04/20 22:12:13 | Save CV results to results/sinkai/images ...
Traceback (most recent call last):
File "evaluator.py", line 184, in
eval_ckpt()
File "evaluator.py", line 180, in eval_ckpt
evaluator.save_each_imgs(gen, loader, save_dir=img_dir, phase=cfg.phase, reduction='mean')
File "/mnt/student/anaconda3/envs/LF_38/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 28, in decorate_context
return func(*args, **kwargs)
File "evaluator.py", line 19, in decorated
ret = val_fn(self, gen, *args, **kwargs)
File "evaluator.py", line 85, in save_each_imgs
for i, (in_style_ids, in_comp_ids, in_imgs, trg_style_ids, trg_comp_ids,
File "/mnt/student/anaconda3/envs/LF_38/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 521, in next
data = self._next_data()
File "/mnt/student/anaconda3/envs/LF_38/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1203, in _next_data
return self._process_data(data)
File "/mnt/student/anaconda3/envs/LF_38/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1229, in _process_data
data.reraise()
File "/mnt/student/anaconda3/envs/LF_38/lib/python3.8/site-packages/torch/_utils.py", line 434, in reraise
raise exception
RuntimeError: Caught RuntimeError in DataLoader worker process 0.
Original Traceback (most recent call last):
File "/mnt/student/anaconda3/envs/LF_38/lib/python3.8/site-packages/torch/utils/data/_utils/worker.py", line 287, in _worker_loop
data = fetcher.fetch(index)
File "/mnt/student/anaconda3/envs/LF_38/lib/python3.8/site-packages/torch/utils/data/utils/fetch.py", line 52, in fetch
return self.collate_fn(data)
File "/mnt/student/2023Students/ZXR/LF_Font/datasets/p2dataset.py", line 263, in collate_fn
torch.cat(in_imgs).unsqueeze(1).repeat_interleave(in_comp_lens, dim=0),
RuntimeError: repeats must have the same size as input along dim
想问一下作者训练的时候采用的图片尺寸是多大的,为什么我直接用代码里面提供训练好的模型进行测试,发现报错,但是之前测试成功了,只是采用的测试数据集不同,其他什么都没有变动,现实报错。
(LF_38) [[38;5;83mlenovo@thinkstationp520:/mnt/student/2023Students/ZXR/LF_Font$ python evaluator.py \
failed to import apex
INFO::04/20 22:12:13 | Resumed checkpoint from /mnt/student/2023Students/ZXR/LF_Font/weight/generator.pth
INFO::04/20 22:12:13 | Save CV results to results/sinkai/images ...
Traceback (most recent call last):
File "evaluator.py", line 184, in
eval_ckpt()
File "evaluator.py", line 180, in eval_ckpt
evaluator.save_each_imgs(gen, loader, save_dir=img_dir, phase=cfg.phase, reduction='mean')
File "/mnt/student/anaconda3/envs/LF_38/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 28, in decorate_context
return func(*args, **kwargs)
File "evaluator.py", line 19, in decorated
ret = val_fn(self, gen, *args, **kwargs)
File "evaluator.py", line 85, in save_each_imgs
for i, (in_style_ids, in_comp_ids, in_imgs, trg_style_ids, trg_comp_ids,
File "/mnt/student/anaconda3/envs/LF_38/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 521, in next
data = self._next_data()
File "/mnt/student/anaconda3/envs/LF_38/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1203, in _next_data
return self._process_data(data)
File "/mnt/student/anaconda3/envs/LF_38/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1229, in _process_data
data.reraise()
File "/mnt/student/anaconda3/envs/LF_38/lib/python3.8/site-packages/torch/_utils.py", line 434, in reraise
raise exception
RuntimeError: Caught RuntimeError in DataLoader worker process 0.
Original Traceback (most recent call last):
File "/mnt/student/anaconda3/envs/LF_38/lib/python3.8/site-packages/torch/utils/data/_utils/worker.py", line 287, in _worker_loop
data = fetcher.fetch(index)
File "/mnt/student/anaconda3/envs/LF_38/lib/python3.8/site-packages/torch/utils/data/utils/fetch.py", line 52, in fetch
return self.collate_fn(data)
File "/mnt/student/2023Students/ZXR/LF_Font/datasets/p2dataset.py", line 263, in collate_fn
torch.cat(in_imgs).unsqueeze(1).repeat_interleave(in_comp_lens, dim=0),
RuntimeError: repeats must have the same size as input along dim