An error with Omegaconf when running continuous image generation code
I found this author's PiggybackGAN code on Github (about continuous learning image generation)
The link below: https://github.com/kaushik333/Piggyback-GAN-Pytorch
The github issue has this problem,but no one has solved.
I want to run this code in my Linux environment. After configuring the environment and data set, I get the following error:
initialize network with normal
initialize network with normal
initialize network with normal
initialize network with normal
Length of loader is  10
learning rate 0.0002000 -&gt; 0.0002000
save image!
Length of loader is  10
learning rate 0.0002000 -&gt; 0.0002000
save image!
...
...
learning rate 0.0000040 -&gt; 0.0000020
save image!
Length of loader is  10
learning rate 0.0000020 -&gt; 0.0000000
save image!
Traceback (most recent call last):
  File &quot;/opt/data/private/Pig/Piggyback-GAN-Pytorch-main/pb_cycleGAN.py&quot;, line 231, in main
    mp.spawn(train, nprocs=len(opt.gpu_ids), args=(opt,))
  File &quot;/root/anaconda3/envs/PiggybackGAN/lib/python3.6/site-packages/torch/multiprocessing/spawn.py&quot;, line 171, in spawn
    while not spawn_context.join():
  File &quot;/root/anaconda3/envs/PiggybackGAN/lib/python3.6/site-packages/torch/multiprocessing/spawn.py&quot;, line 118, in join
    raise Exception(msg)
Exception: 

-- Process 0 terminated with the following error:
Traceback (most recent call last):
  File &quot;/root/anaconda3/envs/PiggybackGAN/lib/python3.6/site-packages/torch/multiprocessing/spawn.py&quot;, line 19, in _wrap
    fn(i, *args)
  File &quot;/opt/data/private/Pig/Piggyback-GAN-Pytorch-main/pb_cycleGAN.py&quot;, line 88, in train
    opt.netG_A_filter_list.append([layer.unc_filt.detach().cpu()])
  File &quot;/root/anaconda3/envs/PiggybackGAN/lib/python3.6/site-packages/omegaconf/listconfig.py&quot;, line 228, in append
    self._format_and_raise(key=index, value=item, cause=e)
  File &quot;/root/anaconda3/envs/PiggybackGAN/lib/python3.6/site-packages/omegaconf/base.py&quot;, line 101, in _format_and_raise
    type_override=type_override,
  File &quot;/root/anaconda3/envs/PiggybackGAN/lib/python3.6/site-packages/omegaconf/_utils.py&quot;, line 629, in format_and_raise
    _raise(ex, cause)
  File &quot;/root/anaconda3/envs/PiggybackGAN/lib/python3.6/site-packages/omegaconf/_utils.py&quot;, line 610, in _raise
    raise ex  # set end OC_CAUSE=1 for full backtrace
  File &quot;/root/anaconda3/envs/PiggybackGAN/lib/python3.6/site-packages/omegaconf/listconfig.py&quot;, line 224, in append
    parent=self,
  File &quot;/root/anaconda3/envs/PiggybackGAN/lib/python3.6/site-packages/omegaconf/omegaconf.py&quot;, line 770, in _maybe_wrap
    ref_type=ref_type,
  File &quot;/root/anaconda3/envs/PiggybackGAN/lib/python3.6/site-packages/omegaconf/omegaconf.py&quot;, line 714, in _node_wrap
    ref_type=ref_type,
  File &quot;/root/anaconda3/envs/PiggybackGAN/lib/python3.6/site-packages/omegaconf/listconfig.py&quot;, line 68, in __init__
    format_and_raise(node=None, key=None, value=None, cause=ex, msg=str(ex))
  File &quot;/root/anaconda3/envs/PiggybackGAN/lib/python3.6/site-packages/omegaconf/_utils.py&quot;, line 629, in format_and_raise
    _raise(ex, cause)
  File &quot;/root/anaconda3/envs/PiggybackGAN/lib/python3.6/site-packages/omegaconf/_utils.py&quot;, line 610, in _raise
    raise ex  # set end OC_CAUSE=1 for full backtrace
  File &quot;/root/anaconda3/envs/PiggybackGAN/lib/python3.6/site-packages/omegaconf/listconfig.py&quot;, line 66, in __init__
    self._set_value(value=content)
  File &quot;/root/anaconda3/envs/PiggybackGAN/lib/python3.6/site-packages/omegaconf/listconfig.py&quot;, line 521, in _set_value
    self.append(item)
  File &quot;/root/anaconda3/envs/PiggybackGAN/lib/python3.6/site-packages/omegaconf/listconfig.py&quot;, line 228, in append
    self._format_and_raise(key=index, value=item, cause=e)
  File &quot;/root/anaconda3/envs/PiggybackGAN/lib/python3.6/site-packages/omegaconf/base.py&quot;, line 101, in _format_and_raise
    type_override=type_override,
  File &quot;/root/anaconda3/envs/PiggybackGAN/lib/python3.6/site-packages/omegaconf/_utils.py&quot;, line 694, in format_and_raise
    _raise(ex, cause)
  File &quot;/root/anaconda3/envs/PiggybackGAN/lib/python3.6/site-packages/omegaconf/_utils.py&quot;, line 610, in _raise
    raise ex  # set end OC_CAUSE=1 for full backtrace
omegaconf.errors.UnsupportedValueType: Value 'Tensor' is not a supported primitive type
    full_key: netG_A_filter_list[0][0]
    reference_type=Optional[List[Any]]
    object_type=list

Set the environment variable HYDRA_FULL_ERROR=1 for a complete stack trace.

Process finished with exit code 1

The information worth paying attention to is
 File &quot;/opt/data/private/Pig/Piggyback-GAN-Pytorch-main/pb_cycleGAN.py&quot;, line 88, in train
    opt.netG_A_filter_list.append([layer.unc_filt.detach().cpu()])

omegaconf.errors.UnsupportedValueType: Value 'Tensor' is not a supported primitive type
    full_key: netG_A_filter_list[0][0]
    reference_type=Optional[List[Any]]
    object_type=list

My GPU only has a single core, not the 4 Gpus of the original author. I found the relevant part in the source code and conducted some tests to eliminate the problem of type mismatch. In addition, the version change of Omegaconf cannot solve my problem. On the right, the type of [layer.unc_filt.detach().cpu()] is list[tensor[]]
about code image
I don't know how to solve this problem now. I don't know whether to modify the code or be affected by the process. Could someone please tell me what I should do?

OmegaConf does not support assignment of non primitive types to the config. This have changed years ago.
There is a possibility that the author used a very old version of OmegaConf that did allow for this assignment, but based on his environment.yaml file he is using 2.0.6 which does not support it.
Contact the author of the code about this issue.
