manicman1999/StyleGAN2-Tensorflow-2.0

load LandscapesBig mode error

Opened this issue · 4 comments

model.load(28)

n1 = noiseList(64)
n2 = nImage(64)
for i in range(50):
    print(i, end = '\r')
    model.generateTruncated(n1, noi = n2, trunc = i / 50, outImage = True, num = i)

error
2020-01-27 14:14:23.735268: W tensorflow/core/common_runtime/base_collective_executor.cc:216] BaseCollectiveExecutor::StartAbort Invalid argument: input and filter must have the same depth: 1536 vs 96
[[{{node conv2d_mod_23/Conv2D}}]]
Traceback (most recent call last):
File "/Users/pig/PycharmProjects/StyleGAN2-Tensorflow-2.0/stylegan_two.py", line 646, in
model.generateTruncated(n1, noi = n2, trunc = i / 50, outImage = True, num = i)
File "/Users/pig/PycharmProjects/StyleGAN2-Tensorflow-2.0/stylegan_two.py", line 567, in generateTruncated
generated_images = self.GAN.GE.predict(w_space + [noi], batch_size = BATCH_SIZE)
File "/Users/pig/anaconda3/envs/tf2/lib/python3.6/site-packages/tensorflow_core/python/keras/engine/training.py", line 909, in predict
use_multiprocessing=use_multiprocessing)
File "/Users/pig/anaconda3/envs/tf2/lib/python3.6/site-packages/tensorflow_core/python/keras/engine/training_arrays.py", line 722, in predict
callbacks=callbacks)
File "/Users/pig/anaconda3/envs/tf2/lib/python3.6/site-packages/tensorflow_core/python/keras/engine/training_arrays.py", line 393, in model_iteration
batch_outs = f(ins_batch)
File "/Users/pig/anaconda3/envs/tf2/lib/python3.6/site-packages/tensorflow_core/python/keras/backend.py", line 3740, in call
outputs = self._graph_fn(*converted_inputs)
File "/Users/pig/anaconda3/envs/tf2/lib/python3.6/site-packages/tensorflow_core/python/eager/function.py", line 1081, in call
return self._call_impl(args, kwargs)
File "/Users/pig/anaconda3/envs/tf2/lib/python3.6/site-packages/tensorflow_core/python/eager/function.py", line 1121, in _call_impl
return self._call_flat(args, self.captured_inputs, cancellation_manager)
File "/Users/pig/anaconda3/envs/tf2/lib/python3.6/site-packages/tensorflow_core/python/eager/function.py", line 1224, in _call_flat
ctx, args, cancellation_manager=cancellation_manager)
File "/Users/pig/anaconda3/envs/tf2/lib/python3.6/site-packages/tensorflow_core/python/eager/function.py", line 511, in call
ctx=ctx)
File "/Users/pig/anaconda3/envs/tf2/lib/python3.6/site-packages/tensorflow_core/python/eager/execute.py", line 67, in quick_execute
six.raise_from(core._status_to_exception(e.code, message), None)
File "", line 3, in raise_from
tensorflow.python.framework.errors_impl.InvalidArgumentError: input and filter must have the same depth: 1536 vs 96
[[node conv2d_mod_23/Conv2D (defined at /anaconda3/envs/tf2/lib/python3.6/site-packages/tensorflow_core/python/framework/ops.py:1751) ]] [Op:__inference_keras_scratch_graph_20999]

Function call stack:
keras_scratch_graph

I have this issue too. Note that 1536 is 16 * 96. Could this be an issue with BATCH_SIZE?
So changing BATCH_SIZE to 1 generates images in the Results folder.

vii33 commented

tensorflow.python.framework.errors_impl.InvalidArgumentError: input and filter must have the same depth: 1536 vs 96

Same problem here. Changing the batch size to 1 helped solving this issue.

Same problem. If you set the batch size to 1 then it works.
But a fix is needed.