Skip to content

Instantly share code, notes, and snippets.

@Wuvist
Created February 14, 2019 06:47
Show Gist options
  • Save Wuvist/3cd9f9c91022e27fd7ce153bffc2fbf6 to your computer and use it in GitHub Desktop.
Save Wuvist/3cd9f9c91022e27fd7ce153bffc2fbf6 to your computer and use it in GitHub Desktop.
Incompatible shapes.log
python .\import_example.py
2019-02-14 10:51:52.592998: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1432] Found device 0 with properties:
name: GeForce GTX 1080 major: 6 minor: 1 memoryClockRate(GHz): 1.7335
pciBusID: 0000:01:00.0
totalMemory: 8.00GiB freeMemory: 6.60GiB
2019-02-14 10:51:52.618169: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1511] Adding visible gpu devices: 0
2019-02-14 10:51:53.007929: I tensorflow/core/common_runtime/gpu/gpu_device.cc:982] Device interconnect StreamExecutor with strength 1 edge matrix:
2019-02-14 10:51:53.022297: I tensorflow/core/common_runtime/gpu/gpu_device.cc:988] 0
2019-02-14 10:51:53.031536: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1001] 0: N
2019-02-14 10:51:53.041526: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1115] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 3276 MB memory) -> physical GPU (device: 0, name: GeForce GTX 1080, pci bus id: 0000:01:00.0, compute capability: 6.1)
Batch has 1 etalons to reverese.
2019-02-14 10:51:58.807852: W tensorflow/core/common_runtime/bfc_allocator.cc:211] Allocator (GPU_0_bfc) ran out of memory trying to allocate 2.14GiB. The caller indicates that this is not a failure, but may mean that there could be performance gains if more memory were available.
Traceback (most recent call last):
File "C:\Users\wuvis\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\client\session.py", line 1334, in _do_call
return fn(*args)
File "C:\Users\wuvis\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\client\session.py", line 1319, in _run_fn
options, feed_dict, fetch_list, target_list, run_metadata)
File "C:\Users\wuvis\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\client\session.py", line 1407, in _call_tf_sessionrun
run_metadata)
tensorflow.python.framework.errors_impl.InvalidArgumentError: Incompatible shapes: [2] vs. [0]
[[{{node gradients/G_paper_1/Run/G_paper_1/4x4/PixelNorm/Mean_grad/floordiv}} = FloorDiv[T=DT_INT32, _device="/job:localhost/replica:0/task:0/device:GPU:0"](gradients/G_paper_1/Run/G_paper_1/4x4/PixelNorm/Mean_grad/Shape, gradients/G_paper_1/Run/G_paper_1/4x4/PixelNorm/Mean_grad/Maximum)]]
[[{{node Sum/_737}} = _Recv[client_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device_incarnation=1, tensor_name="edge_3653_Sum", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:CPU:0"]()]]
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File ".\import_example.py", line 60, in <module>
history = Gs.reverse_gan_for_etalons(latents, labels, img)
File "D:\code\progressive_growing_of_gans\tfutil.py", line 829, in reverse_gan_for_etalons
l = tf.get_default_session().run([loss, gradient], feed_dict=feed_dict)
File "C:\Users\wuvis\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\client\session.py", line 929, in run
run_metadata_ptr)
File "C:\Users\wuvis\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\client\session.py", line 1152, in _run
feed_dict_tensor, options, run_metadata)
File "C:\Users\wuvis\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\client\session.py", line 1328, in _do_run
run_metadata)
File "C:\Users\wuvis\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\client\session.py", line 1348, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.InvalidArgumentError: Incompatible shapes: [2] vs. [0]
[[node gradients/G_paper_1/Run/G_paper_1/4x4/PixelNorm/Mean_grad/floordiv (defined at D:\code\progressive_growing_of_gans\tfutil.py:807) = FloorDiv[T=DT_INT32, _device="/job:localhost/replica:0/task:0/device:GPU:0"](gradients/G_paper_1/Run/G_paper_1/4x4/PixelNorm/Mean_grad/Shape, gradients/G_paper_1/Run/G_paper_1/4x4/PixelNorm/Mean_grad/Maximum)]]
[[{{node Sum/_737}} = _Recv[client_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device_incarnation=1, tensor_name="edge_3653_Sum", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:CPU:0"]()]]
Caused by op 'gradients/G_paper_1/Run/G_paper_1/4x4/PixelNorm/Mean_grad/floordiv', defined at:
File ".\import_example.py", line 60, in <module>
history = Gs.reverse_gan_for_etalons(latents, labels, img)
File "D:\code\progressive_growing_of_gans\tfutil.py", line 807, in reverse_gan_for_etalons
gradient = tf.gradients(loss, input_latents)
File "C:\Users\wuvis\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\ops\gradients_impl.py", line 630, in gradients
gate_gradients, aggregation_method, stop_gradients)
File "C:\Users\wuvis\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\ops\gradients_impl.py", line 814, in _GradientsHelper
lambda: grad_fn(op, *out_grads))
File "C:\Users\wuvis\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\ops\gradients_impl.py", line 408, in _MaybeCompile
return grad_fn() # Exit early
File "C:\Users\wuvis\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\ops\gradients_impl.py", line 814, in <lambda>
lambda: grad_fn(op, *out_grads))
File "C:\Users\wuvis\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\ops\math_grad.py", line 119, in _MeanGrad
sum_grad = _SumGrad(op, grad)[0]
File "C:\Users\wuvis\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\ops\math_grad.py", line 82, in _SumGrad
tile_scaling = _safe_shape_div(input_shape, output_shape_kept_dims)
File "C:\Users\wuvis\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\ops\math_grad.py", line 35, in _safe_shape_div
return x // math_ops.maximum(y, 1)
File "C:\Users\wuvis\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\ops\math_ops.py", line 866, in binary_op_wrapper
return func(x, y, name=name)
File "C:\Users\wuvis\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\ops\math_ops.py", line 1111, in floordiv
return gen_math_ops.floor_div(x, y, name=name)
File "C:\Users\wuvis\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\ops\gen_math_ops.py", line 3079, in floor_div
"FloorDiv", x=x, y=y, name=name)
File "C:\Users\wuvis\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\op_def_library.py", line 787, in _apply_op_helper
op_def=op_def)
File "C:\Users\wuvis\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\util\deprecation.py", line 488, in new_func
return func(*args, **kwargs)
File "C:\Users\wuvis\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\ops.py", line 3274, in create_op
op_def=op_def)
File "C:\Users\wuvis\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\ops.py", line 1770, in __init__
self._traceback = tf_stack.extract_stack()
...which was originally created as op 'G_paper_1/Run/G_paper_1/4x4/PixelNorm/Mean', defined at:
File ".\import_example.py", line 60, in <module>
history = Gs.reverse_gan_for_etalons(latents, labels, img)
File "D:\code\progressive_growing_of_gans\tfutil.py", line 782, in reverse_gan_for_etalons
out_expr = self.get_output_for(*in_split[gpu], return_as_list=True, **dynamic_kwargs)
File "D:\code\progressive_growing_of_gans\tfutil.py", line 509, in get_output_for
out_expr = self._build_func(*named_inputs, **all_kwargs)
File "<string>", line 224, in G_paper
File "<string>", line 219, in grow
File "<string>", line 181, in block
File "<string>", line 122, in pixel_norm
File "C:\Users\wuvis\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\util\deprecation.py", line 488, in new_func
return func(*args, **kwargs)
File "C:\Users\wuvis\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\ops\math_ops.py", line 1495, in reduce_mean
name=name))
File "C:\Users\wuvis\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\ops\gen_math_ops.py", line 4778, in mean
name=name)
File "C:\Users\wuvis\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\op_def_library.py", line 787, in _apply_op_helper
op_def=op_def)
File "C:\Users\wuvis\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\util\deprecation.py", line 488, in new_func
return func(*args, **kwargs)
File "C:\Users\wuvis\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\ops.py", line 3274, in create_op
op_def=op_def)
File "C:\Users\wuvis\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\ops.py", line 1770, in __init__
self._traceback = tf_stack.extract_stack()
InvalidArgumentError (see above for traceback): Incompatible shapes: [2] vs. [0]
[[node gradients/G_paper_1/Run/G_paper_1/4x4/PixelNorm/Mean_grad/floordiv (defined at D:\code\progressive_growing_of_gans\tfutil.py:807) = FloorDiv[T=DT_INT32, _device="/job:localhost/replica:0/task:0/device:GPU:0"](gradients/G_paper_1/Run/G_paper_1/4x4/PixelNorm/Mean_grad/Shape, gradients/G_paper_1/Run/G_paper_1/4x4/PixelNorm/Mean_grad/Maximum)]]
[[{{node Sum/_737}} = _Recv[client_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device_incarnation=1, tensor_name="edge_3653_Sum", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:CPU:0"]()]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment