NVlabs / stylegan2-ada-pytorch

StyleGAN2-ADA - Official PyTorch implementation
https://arxiv.org/abs/2006.06676
Other
4.07k stars 1.16k forks source link

Failure to load data in _seralization.py #181

Open ss32 opened 3 years ago

ss32 commented 3 years ago

OS: Ubuntu 18.04 GPU: RTX 3080ti

Running the Docker container I am met with the following error. This is repeatable across new models, checkpoints, and various datasets

tick 0     kimg 0.0      time 23s          sec/tick 2.2     sec/kimg 140.42  maintenance 21.2   cpumem 4.80   gpumem 9.10   augment 0.000
Evaluating metrics...
Traceback (most recent call last):
  File "train.py", line 538, in <module>
    main() # pylint: disable=no-value-for-parameter
  File "/opt/conda/lib/python3.8/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/opt/conda/lib/python3.8/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/opt/conda/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/opt/conda/lib/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/opt/conda/lib/python3.8/site-packages/click/decorators.py", line 21, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "train.py", line 531, in main
    subprocess_fn(rank=0, args=args, temp_dir=temp_dir)
  File "train.py", line 383, in subprocess_fn
    training_loop.training_loop(rank=rank, **args)
  File "/scratch/training/training_loop.py", line 374, in training_loop
    result_dict = metric_main.calc_metric(metric=metric, G=snapshot_data['G_ema'],
  File "/scratch/metrics/metric_main.py", line 45, in calc_metric
    results = _metric_dict[metric](opts)
  File "/scratch/metrics/metric_main.py", line 85, in fid50k_full
    fid = frechet_inception_distance.compute_fid(opts, max_real=None, num_gen=50000)
  File "/scratch/metrics/frechet_inception_distance.py", line 25, in compute_fid
    mu_real, sigma_real = metric_utils.compute_feature_stats_for_dataset(
  File "/scratch/metrics/metric_utils.py", line 211, in compute_feature_stats_for_dataset
    detector = get_feature_detector(url=detector_url, device=opts.device, num_gpus=opts.num_gpus, rank=opts.rank, verbose=progress.verbose)
  File "/scratch/metrics/metric_utils.py", line 48, in get_feature_detector
    _feature_detector_cache[key] = torch.jit.load(f).eval().to(device)
  File "/opt/conda/lib/python3.8/site-packages/torch/jit/_serialization.py", line 163, in load
    cpp_module = torch._C.import_ir_module_from_buffer(
RuntimeError: [enforce fail at inline_container.cc:140] . PytorchStreamReader failed reading zip archive: not a ZIP archive
ss32 commented 3 years ago

I have encountered the same issue after building from source

inmchoi commented 2 years ago

It is missing feature detector Basically codes wants to read some model that can calculate metric, but it is missing So for now I have added --metric=none for temporal solution

File "/scratch/metrics/metric_utils.py", line 211, in compute_feature_stats_for_dataset detector = get_feature_detector(url=detector_url, device=opts.device, num_gpus=opts.num_gpus, rank=opts.rank,

May be url is changed

WathikAhmed commented 2 years ago

Same issue, heres my side of things: I run the code using the following command: python train.py --outdir=C:\gan\training\run1 --data=C:\gan\cleanDatasets\dataset1out --mirror=1 --resume=C:\gan\pkl\FreaGAN.pkl log2.txt

RichardChen20 commented 2 years ago

Same problem I had. I solved it by doing this: download the model from the url first, then rename it and move it to the path '/home/user_name/.cache/dnnlib/downloads'. You can first check the path '/home/user_name/.cache/dnnlib/downloads' to find the name for the inception_v3 file. Besides, I found pytorch1.9 didn't work, pytorch1.7 was OK.