quolc / neural-collage

Collaging on Internal Representations: An Intuitive Approach for Semantic Transfiguration
MIT License
566 stars 89 forks source link

NeuralCollage_demo.ipynb TypeError #11

Open dorianss opened 3 years ago

dorianss commented 3 years ago

Hello, I run NeuralCollage_demo.ipynb in colab. It show TypeError. How can it work pretty?

# perform blending
arguments = "--gpu 0 \
--config ./configs/sn_projection_dog_and_cat_256_scbn.yml \
--snapshot sn_projection_dog_and_cat_256_large/ResNetGenerator_450000.npz \
--results_dir log/log/gen_spatially_interpolated_images_with_feature_blend  \
--z1 ./src.npy \
--z2 ./ref.npy \
--class_mask ./examples/mask_1.png \
--classes {} {}".format(target_class, src_class)

!python evaluations/gen_spatially_interpolated_images_with_feature_blend.py $arguments

Output

(45, 99)
Traceback (most recent call last):
  File "evaluations/gen_spatially_interpolated_images_with_feature_blend.py", line 141, in <module>
    main()
  File "evaluations/gen_spatially_interpolated_images_with_feature_blend.py", line 124, in main
    x = gen.spatial_interpolation(zs=[z1, z2], weights=ws, blends=blends)
  File "gen_models/resnet_256_scbn.py", line 77, in spatial_interpolation
    hs.append(chainer.Variable(self.xp.zeros_like(hs[0]))) # dummy
  File "/usr/local/lib/python3.7/dist-packages/cupy/creation/basic.py", line 238, in zeros_like
    shape)
  File "/usr/local/lib/python3.7/dist-packages/cupy/creation/basic.py", line 42, in _new_like_order_and_strides
    order = chr(_update_order_char(a, ord(order)))
TypeError: Argument 'x' has incorrect type (expected cupy.core.core.ndarray, got Variable)
HonEy-WY commented 2 years ago

Hi!I encountered the same problem as you during training. Have you solved it?