tg-bomze / BabyGAN

StyleGAN-based predictor of children's faces from photos of theoretical parents.
341 stars 63 forks source link

Error in Get latent representation Block #17

Closed muhammad-ahmed-ghani closed 2 years ago

muhammad-ahmed-ghani commented 2 years ago
Traceback (most recent call last):
  File "encode_images.py", line 242, in <module>
    main()
  File "encode_images.py", line 176, in main
    for loss_dict in pbar:
  File "/usr/local/lib/python3.7/dist-packages/tqdm/std.py", line 1195, in __iter__
    for obj in iterable:
  File "/content/BabyGAN/encoder/perceptual_model.py", line 291, in optimize
    min_op = optimizer.minimize(self.loss, var_list=[vars_to_optimize])
  File "/tensorflow-1.15.2/python3.7/tensorflow_core/contrib/optimizer_v2/optimizer_v2.py", line 724, in minimize
    grads_and_vars, global_step=global_step, name=name)
  File "/tensorflow-1.15.2/python3.7/tensorflow_core/contrib/optimizer_v2/optimizer_v2.py", line 879, in apply_gradients
    kwargs={"global_step": global_step, "name": name})
  File "/tensorflow-1.15.2/python3.7/tensorflow_core/python/distribute/distribute_lib.py", line 1940, in merge_call
    return self._merge_call(merge_fn, args, kwargs)
  File "/tensorflow-1.15.2/python3.7/tensorflow_core/python/distribute/distribute_lib.py", line 1947, in _merge_call
    return merge_fn(self._strategy, *args, **kwargs)
  File "/tensorflow-1.15.2/python3.7/tensorflow_core/contrib/optimizer_v2/optimizer_v2.py", line 938, in _distributed_apply
    self._create_vars(var_list, state)
  File "/tensorflow-1.15.2/python3.7/tensorflow_core/contrib/opt/python/training/ggt.py", line 143, in _create_vars
    [window, idx], dtype=var_list[0].dtype.base_dtype)
  File "/tensorflow-1.15.2/python3.7/tensorflow_core/python/ops/array_ops.py", line 2338, in zeros
    output = _constant_if_small(zero, shape, dtype, name)
  File "/tensorflow-1.15.2/python3.7/tensorflow_core/python/ops/array_ops.py", line 2295, in _constant_if_small
    if np.prod(shape) < 1000:
  File "<__array_function__ internals>", line 6, in prod
  File "/usr/local/lib/python3.7/dist-packages/numpy/core/fromnumeric.py", line 3052, in prod
    keepdims=keepdims, initial=initial, where=where)
  File "/usr/local/lib/python3.7/dist-packages/numpy/core/fromnumeric.py", line 86, in _wrapreduction
    return ufunc.reduce(obj, axis, dtype, out, **passkwargs)
  File "/tensorflow-1.15.2/python3.7/tensorflow_core/python/framework/ops.py", line 736, in __array__
    " array.".format(self.name))

NotImplementedError: Cannot convert a symbolic Tensor (GGT/window:0) to a numpy array.