Ldhlwh / DFMGAN

[AAAI 2023] Official implementation of "Few-Shot Defect Image Generation via Defect-Aware Feature Manipulation".
https://arxiv.org/abs/2303.02389
Other
87 stars 12 forks source link

预训练时报错 #33

Closed zhaoxueyi6 closed 5 months ago

zhaoxueyi6 commented 5 months ago

预训练时报错,网上找不到相关的问题,可否给点提示

Traceback (most recent call last): File "/home/zxy/exp/DFMGAN-main/train.py", line 645, in main() # pylint: disable=no-value-for-parameter File "/home/zxy/anaconda3/envs/dftgan/lib/python3.9/site-packages/click/core.py", line 1157, in call return self.main(args, kwargs) File "/home/zxy/anaconda3/envs/dftgan/lib/python3.9/site-packages/click/core.py", line 1078, in main rv = self.invoke(ctx) File "/home/zxy/anaconda3/envs/dftgan/lib/python3.9/site-packages/click/core.py", line 1434, in invoke return ctx.invoke(self.callback, ctx.params) File "/home/zxy/anaconda3/envs/dftgan/lib/python3.9/site-packages/click/core.py", line 783, in invoke return __callback(args, kwargs) File "/home/zxy/anaconda3/envs/dftgan/lib/python3.9/site-packages/click/decorators.py", line 33, in new_func return f(get_current_context(), *args, kwargs) File "/home/zxy/exp/DFMGAN-main/train.py", line 638, in main subprocess_fn(rank=0, args=args, temp_dir=temp_dir) File "/home/zxy/exp/DFMGAN-main/train.py", line 473, in subprocess_fn training_loop.training_loop(rank=rank, args) File "/home/zxy/exp/DFMGAN-main/training/training_loop.py", line 532, in training_loop result_dict = metric_main.calc_metric(metric=metric, G=snapshot_data['G_ema'], File "/home/zxy/exp/DFMGAN-main/metrics/metric_main.py", line 46, in calc_metric results = _metric_dictmetric File "/home/zxy/exp/DFMGAN-main/metrics/metric_main.py", line 86, in fid50k_full fid = frechet_inception_distance.compute_fid(opts, max_real=None, num_gen=50000) File "/home/zxy/exp/DFMGAN-main/metrics/frechet_inception_distance.py", line 29, in compute_fid mu_gen, sigma_gen = metric_utils.compute_feature_stats_for_generator( File "/home/zxy/exp/DFMGAN-main/metrics/metric_utils.py", line 280, in compute_feature_stats_for_generator features = detector(images, *detector_kwargs) File "/home/zxy/anaconda3/envs/dftgan/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1051, in _call_impl return forward_call(input, kwargs) RuntimeError: MALFORMED INPUT: lanes dont match

Ldhlwh commented 5 months ago

这两个issue或许有帮助 https://github.com/NVlabs/stylegan3/issues/20 https://github.com/pytorch/pytorch/issues/64062

zhaoxueyi6 commented 5 months ago

感谢!我跳过了metrics,还有一个问题,在Transfer的部分报错Traceback (most recent call last): File "/home/zxy/exp/DFMGAN-main/train.py", line 645, in main() # pylint: disable=no-value-for-parameter File "/home/zxy/anaconda3/envs/dftgan/lib/python3.9/site-packages/click/core.py", line 1157, in call return self.main(args, kwargs) File "/home/zxy/anaconda3/envs/dftgan/lib/python3.9/site-packages/click/core.py", line 1078, in main rv = self.invoke(ctx) File "/home/zxy/anaconda3/envs/dftgan/lib/python3.9/site-packages/click/core.py", line 1434, in invoke return ctx.invoke(self.callback, ctx.params) File "/home/zxy/anaconda3/envs/dftgan/lib/python3.9/site-packages/click/core.py", line 783, in invoke return __callback(args, *kwargs) File "/home/zxy/anaconda3/envs/dftgan/lib/python3.9/site-packages/click/decorators.py", line 33, in new_func return f(get_current_context(), args, kwargs) File "/home/zxy/exp/DFMGAN-main/train.py", line 638, in main subprocess_fn(rank=0, args=args, temp_dir=temp_dir) File "/home/zxy/exp/DFMGAN-main/train.py", line 473, in subprocess_fn training_loop.training_loop(rank=rank, args) File "/home/zxy/exp/DFMGAN-main/training/training_loop.py", line 169, in training_loop resume_data = legacy.load_network_pkl(f) File "/home/zxy/exp/DFMGAN-main/legacy.py", line 21, in load_network_pkl data = _LegacyUnpickler(f).load() _pickle.UnpicklingError: invalid load key, '\xcf',我试了重新下载pkl文件也不行,我想是不是pickle版本的问题,可否问一下您的pickle版本

Ldhlwh commented 5 months ago

我用的是python 3.8.12自带的pickle

zhaoxueyi6 commented 5 months ago

收到,感谢回复!

赵雪屹 @.***

 

------------------ 原始邮件 ------------------ 发件人: "Ldhlwh/DFMGAN" @.>; 发送时间: 2024年5月29日(星期三) 晚上10:20 @.>; @.**@.>; 主题: Re: [Ldhlwh/DFMGAN] 预训练时报错 (Issue #33)

我用的是python 3.8.12自带的pickle

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>