menyifang / DCT-Net

Official implementation of "DCT-Net: Domain-Calibrated Translation for Portrait Stylization", SIGGRAPH 2022 (TOG); Multi-style cartoonization
Apache License 2.0
734 stars 74 forks source link

NotImplementedError: Cannot convert a symbolic Tensor (strided_slice:0) to a numpy array. #37

Open goldwater668 opened 1 year ago

goldwater668 commented 1 year ago

Traceback (most recent call last): File "train_localtoon.py", line 36, in main(args) File "train_localtoon.py", line 25, in main max_steps=max_steps) File "/opt/conda/lib/python3.7/site-packages/modelscope/trainers/cv/cartoon_translation_trainer.py", line 99, in init self.input_superpixel) File "/opt/conda/lib/python3.7/site-packages/modelscope/models/cv/cartoon/model_tf.py", line 39, in call output_cartoon = guided_filter(input_photo, output, r=1) File "/opt/conda/lib/python3.7/site-packages/modelscope/models/cv/cartoon/loss.py", line 209, in guided_filter tf.ones((1, x_shape[1], x_shape[2], 1), dtype=x.dtype), r) File "/opt/conda/lib/python3.7/site-packages/tensorflow_core/python/ops/array_ops.py", line 2560, in ones output = _constant_if_small(one, shape, dtype, name) File "/opt/conda/lib/python3.7/site-packages/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 "/opt/conda/lib/python3.7/site-packages/numpy/core/fromnumeric.py", line 3052, in prod keepdims=keepdims, initial=initial, where=where) File "/opt/conda/lib/python3.7/site-packages/numpy/core/fromnumeric.py", line 86, in _wrapreduction return ufunc.reduce(obj, axis, dtype, out, **passkwargs) File "/opt/conda/lib/python3.7/site-packages/tensorflow_core/python/framework/ops.py", line 736, in array " array.".format(self.name)) NotImplementedError: Cannot convert a symbolic Tensor (strided_slice:0) to a numpy array.

menyifang commented 1 year ago

numpy version is not compatible with tf1.x, numpy==1.18.5 may help